home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / helppc.zip / ASM.TXT next >
Text File  |  1990-11-27  |  109KB  |  3,473 lines

  1. @Assembler Programming Topics
  2. :asm:8086 architecture
  3. ^Intel 8086 Family Architecture
  4.  
  5. %General Purpose Registers                 Segment Registers
  6.  
  7.  AX  AH/AL  (EAX)    Accumulator          CS    Code Segment
  8.  BX  BH/BL  (EBX)    Base                 DS    Data Segment
  9.  CX  CH/CL  (ECX)    Counter              SS    Stack Segment
  10.  DX  DH/DL  (EDX)    Data                 ES    Extra Segment
  11.                                          (FS)   386 only
  12.  (reg) indicates 386                     (GS)   386 only
  13.  
  14.  
  15. %Pointer Registers                         Stack Registers
  16.  
  17.  SI (ESI)  Source Index               SP (ESP)   Stack Pointer
  18.  DI (EDI)  Destination Index          BP (EBP)   Base Pointer
  19.  IP        Instruction Pointer
  20.  
  21. %Status Registers
  22.  
  23.  FLAGS Status Flags   (see FLAGS)
  24.  
  25.  
  26. %Register      Default Segment       Valid Overrides
  27.  
  28.  BP                  SS               DS, ES, CS
  29.  SI or DI            DS               ES, SS, CS
  30.  DI strings          ES               None
  31.  SI strings          DS               ES, SS, CS
  32.  
  33.  
  34. ^8088/8086  Effective Address (EA) Calculation
  35.  
  36. %                Description                  Clock Cycles
  37.  
  38.  Displacement                                       6
  39.  Base or Index (BX,BP,SI,DI)                        5
  40.  Displacement+(Base or Index)                       9
  41.  Base+Index (BP+DI,BX+SI)                           7
  42.  Base+Index (BP+SI,BX+DI)                           8
  43.  Base+Index+Displacement (BP+DI,BX+SI)             11
  44.  Base+Index+Displacement (BP+SI+disp,BX+DI+disp)   12
  45.  
  46.  
  47.  - add 4 cycles for word operands at odd addresses
  48.  - add 2 cycles for segment override
  49.  - 80188/80186 timings differ from those of the 8088/8086/80286
  50.  
  51.  
  52. ^Instruction Clock Cycle Calculation
  53.  
  54.  Some instructions require additional clock cycles due to a "Next
  55.  Instruction Component" identified by a "+m" in the instruction
  56.  clock cycle listings.  This is due to the prefetch queue being
  57.  purge on a control transfers.   Below is the general rule for
  58.  calculating "m":
  59.  
  60.  
  61.   88/86 not applicable
  62.    286  "m" is the number of bytes in the next instruction
  63.    386  "m" is the number of components in the next instruction
  64.         (the instruction coding (each byte), plus the data and
  65.          the displacement are all considered components)
  66.  
  67.  
  68.  - all timings are for best case and do not take into account wait
  69.    states, instruction alignment or the state of the prefetch queue
  70.  - to convert clocks to nanoseconds divide one microsecond by the
  71.    processor speed in MegaHertz:
  72.    
  73. ^(1000MHz/(n MHz)) = X nanoseconds
  74.  
  75.  - see   CPU   DETECTING
  76. :directives:asm directives
  77. ^Macro Assembler Directives
  78.  
  79. ^Processor Code Generation Directives
  80.  
  81.  .186       enables assembly of 80186 instructions
  82.  .286       enables assembly of non privileged 80286 instructions
  83.  .286C      same as .286
  84.  .286P      enables assembly of all 80286 instructions
  85.  .287       enabled assembly of 80287 instructions
  86.  .386       enabled assembly of non privileged 80386 instructions
  87.             If used before .MODEL segments are defined as 32bits.
  88.             Causes all segments to default to DWORD alignment.
  89.  .386P      enabled assembly of all 80386 instructions (see .386)
  90.  .387       enabled assembly of 80387 instructions
  91.  .8086      default, enables assembly of 8088/8086 instruction
  92.  .8087      default, enables assembly of 8087 instructions
  93.  
  94.  
  95.  These directives must precede the segment they are to effect.  they
  96.  cannot occur within a segment.
  97.  
  98.  
  99. ^Memory Model Directives
  100.  
  101.  .CODE     [name]   starts code segment; must follow .MODEL directive
  102.  .CONST             starts a constant data segment with name CONST;
  103.                     must follow .MODEL directive; placed in DGROUP
  104.  .DATA              starts a near data segment for initialized data
  105.                     with name _DATA; must follow .MODEL directive;
  106.                     placed in DGROUP
  107.  .DATA?             starts a near data segment for uninitialized
  108.                     data with name _BSS; must follow .MODEL
  109.                     directive; placed in DGROUP
  110.  .FARDATA  [name]   not placed in any group
  111.  .FARDATA? [name]   not placed in any group
  112.  .MODEL    model    defines memory model to be one of the following:
  113.                     SMALL, COMPACT, MEDIUM, LARGE or HUGE;  must be
  114.                     used prior to any other segment directive
  115.  .STACK    [size]   indicates start of stack segment named 'STACK'
  116.                     with size indicating number of bytes to reserve,
  117.                     default is 1k; placed in DGROUP
  118.  
  119.  
  120. ^Segment Definition, Segment Ordering and Linkage Directives
  121.  
  122.       .ALPHA    orders segments alphabetically
  123.       .SEQ      orders segments sequentially (default)
  124.       ASSUME sreg:name [,sreg:name...]   selects default segment
  125.                 register to be used by the assembler, not the CPU,
  126.                 for addressing all symbols in the segment or group.
  127.                 Name must be associated with a SEGMENT or GROUP
  128.                 or set to "NOTHING" to indicate no segment register
  129.                 is to be associated.
  130.       COMM definition [,definition...]  defines variables that are
  131.                 both public and external (communal).   Can be used
  132.                 in and include file to identify it to each source
  133.                 file without declaring it in each model as extern.
  134.                 Actually defines data once.   Communal variables
  135.                 cannot be initialized, and are not guaranteed to
  136.                 be allocated contiguously since these are allocated
  137.                 by the linker.
  138.       DOSSEG    orders segments the same as DOS.  This is Microsoft
  139.                 languages default order; causes paragph alignment
  140.       END [name]  marks end of source module and sets program
  141.                 start address (CS:IP) if 'name' is present
  142.  name ENDP      ends procedure 'name'
  143.  name ENDS      ends a segment or structure
  144.       EXTRN name:type [,name:type...]  defines one or more external symbols
  145.  name GROUP segment[,segment]
  146.  name LABEL [NEAR|FAR|PROC]  defines an entry point;  If PROC is
  147.                 specified, it's value depends on the current MODEL
  148.       NAME pgm  ignored since MASM 5.0; used to set module name
  149.  name PROC [NEAR|FAR]  defines procedure; NEAR/FAR has .MODEL default
  150.       PUBLIC name[,name...]  makes symbol 'name' available to other modules
  151.  name SEGMENT [align][combine][use]['class']
  152.          align = BYTE    align on byte address (no alignment)
  153.                = WORD    align on even address
  154.                = DWORD   align on DWORD address
  155.                = PARA    align on next 16 byte paragraph
  156.                = PAGE    align on next 256 byte boundary
  157.        combine = PUBLIC  similar named segments are concatenated (CS)
  158.                = STACK   similar named segments are concatenated (SS)
  159.                = COMMON  similar named segment are overlapped
  160.                = MEMORY  similar names segments are concatenated
  161.                = AT addr segment relative to absolute address
  162.                = nothing segment is private and loaded independent
  163.            use = USE16   segments will be 16 bits (if .386)
  164.                = USE32   segments will be 32 bits (if .386)
  165.  
  166.  
  167. ^Data Allocation Directives
  168.  
  169.          ALIGN n  aligns next variable or instruction on a boundary
  170.                   that is a multiple of "n".  This can speed memory
  171.                   fetches on 16 and 32 bit CPU'S if aligned.  New to
  172.                   MASM 5.0, previous versions used EVEN.  Can result
  173.                   in NOP's added to code.
  174.  [name]  DB    init[,init...]   define byte
  175.  [name]  DD    init[,init...]   define double word (DWORD, 4 bytes)
  176.  [name]  DF    init[,init...]   define far word (FWORD, 386, 6 bytes)
  177.  [name]  DQ    init[,init...]   define quad word (QWORD, 8 bytes)
  178.  [name]  DT    init[,init...]   define temp word (TBYTE, 10 bytes)
  179.  [name]  DW    init[,init...]   define word (WORD, 2 bytes)
  180.  count   DUP   (init[,init...]) duplicate 'init' 'count' times;  DUP
  181.                   can be nested to 17 levels; DUP'ed initial values
  182.                   of (?) don't result in data in the object file but
  183.                   instead increment the next data addr
  184.  name    ENDS     end of structure or segment
  185.          EVEN     same as align 2;  Aligns data on even boundary
  186.          ORG expr sets location counter to 'expr';  If 'expr'
  187.                   is '$' the code is ORG'ed at the current loc.
  188.  name    RECORD field[,field...]   defines a byte or word variable
  189.                   consisting of bit fields;  fields have the format:
  190.                   fieldname:width[=expr];  the sum of all widths
  191.                   must be <= 0
  192.  [name]  STRUC <[init[,init]]>  defines beginning of a structure;
  193.                   Values between <> are initializers;  The '<>'
  194.                   symbols are required.
  195.  
  196.  
  197. ^Logical and Bit Oriented Directives
  198.  
  199.  expr1  AND   expr2   returns nonzero if any set bit matches
  200.  expr1  EQ    expr2   returns (-1) for true or (0) for false
  201.  expr1  GE    expr2   returns (-1) for true or (0) for false
  202.  expr1  LE    expr2   returns (-1) for true or (0) for false
  203.  expr1  LT    expr2   returns (-1) for true or (0) for false
  204.         MASK  {fldname|record}  returns bit mask for bits in record
  205.  expr1  OR    expr2   returns bitwise OR on expr1 and expr2
  206.         NOT   expr    returns 'expr' with all bits reversed
  207.  expr   SHL   count   returns expr shifted left count times
  208.  expr   SHR   count   returns expr shifted right count times
  209.         WIDTH {fldname|record}  returns width of field in bit record
  210.  expr1  XOR   expr2   returns bitwise XOR on expr1 and expr2
  211.  
  212.  
  213. ^Other Operators and Directives
  214.  
  215.        []             index operator, same as addition
  216.        .MSFLOAT       encode floats in Microsoft Real Format
  217.        .TYPE  expr    returns byte defining mode and scope of expr
  218.  name  EQU [<]expr[>] assigns expression to name. <> indicates text
  219.        HIGH   expr    returns high byte of 'expr'
  220.        INCLUDE filespec     inserts code from 'filespec' into file
  221.        INCLUDELIB filespec  stores link library info in .OBJ file
  222.        LENGTH var     returns number of data objects in DUPed 'var'
  223.        LOW    expr    returns low byte of 'expr'
  224.  expr1 MOD    expr2   return remainder of expr1/expr2
  225.        OFFSET expr    returns offset of expr;   When .MODEL is used
  226.                       the offset of a group relative segment refers
  227.                       to the end of the segment
  228.  type  PTR    expr    forces 'expr' to 'type'
  229.        SEG    expr    returns segment of expression
  230.        SHORT          sets type of label to short, less than 128
  231.                       bytes from start of next instruction
  232.        SIZE   var     returns # of bytes allocated by DUP directive
  233.        THIS   type    returns an operand of specified type whose
  234.                       offset and segment values are equal to the
  235.                       current location
  236.        TYPE   expr    returns type of expression
  237.  
  238.  
  239. %Program Listing and Documentation Directives
  240.  
  241.      .CREF          restores listing of cross reference symbols
  242.      .LALL          include macro expansion in listings
  243.      .LFCOND        include false conditional blocks in listings
  244.      .LIST          starts listing of statements
  245.      .SALL          suppress listing of all macro expansions
  246.      .SFCOND        suppress false conditional blocks in listings
  247.      .XALL          start listing of macro expansion
  248.      .XCREF [name[,name...]]  suppress symbols in cross reference
  249.      .XLIST         suppress program listing
  250.      COMMENT delimiter [text]
  251.      PAGE   [[len],wid]  sets page length&width or ejects if no parms
  252.      SUBTTL text    defines program listing subtitle
  253.      TITLE  text    defines program listing title
  254.  
  255.  
  256. %Condition Assembly Directives
  257.  
  258.  ELSE             else clause for conditional assembly block
  259.  ENDIF            terminates a conditional assembly block
  260.  IFDEF   name     conditional assembly if name is defined
  261.  
  262.  
  263. %Macro Definition Directives
  264.  
  265.       ENDM                 terminates a macro block
  266.       EXITM                exit macro expansion immediately
  267.       IRP   parm,<arg[,arg...]> parm in the statements enclosed by
  268.                            the IRP and ENDM will be repeated and
  269.                            replaced with the values of "arg" for
  270.                            each "arg" in the <>.
  271.       IRPC  parm,<string>  parm in the statements enclosed by the
  272.                            IRPC and ENDM will be repeated and
  273.                            replaced with the values of each char in
  274.                            the "string" for each character position
  275.                            in the string.  "string" should be
  276.                            enclosed in <> if it contains spaces
  277.                            or other separators.
  278.       LOCAL name[,name...] defines scope symbol as local to a macro
  279.  name MACRO [parm[,parm...]]  defines a macro and it's parameters
  280.       PURGE name[,name]    purges macros from memory
  281.       REPT  expr           repeats all statements through ENDM
  282.                            statement 'expr' times
  283.  
  284.  
  285. %User Message Directives
  286.  
  287.  .ERR                   generates and error
  288.  .ERR1                  generates an error on PASS 1
  289.  .ERR2                  generates an error on PASS 2
  290.  .ERRB   <arg>          generates an error if 'arg' is blank
  291.  .ERRDEF name           generates an error if 'name' is previously defined
  292.  .ERRDIF[I] <arg1>,<arg2>
  293.  .ERRE   expr           generates and error is 'expr' is false
  294.  %OUT    text           displays 'text' to console
  295.  
  296.  
  297. %Predefined Equates (available only if simplified segments are used)
  298.  
  299.  @curseg       contains the current segment
  300.  @filename     current file name without extension
  301.  @code         contains the current code segment
  302.  @codesize     0 for small & compact, 1 for large, medium & huge
  303.  @datasize     0 for small & medium, 1 for compact & large, 2=huge
  304.  @const        contains segment of define by .CONST
  305.  @data         contains segment of define by .DATA
  306.  @data?        contains segment of define by .DATA?
  307.  @fardata      contains segment of define by .FARDATA
  308.  @fardata?     contains segment of define by .FARDATA?
  309.  @stack        contains segment of define by .STACK
  310.  
  311.  Most of these are only available if the simplified segment system
  312.  is used.   @curseg and @filename are available regardless.
  313.  
  314.  
  315. %Radix Specifiers
  316.  
  317.  .RADIX expr         sets radix [2..16] for numbers (dec. default)
  318.  B                   binary data specifier
  319.  Q                   octal data specifier
  320.  O                   octal data specifier
  321.  D                   decimal data specifier
  322.  H                   hexadecimal data specifier
  323.  
  324.  
  325. :masm options:assembler options
  326. ^Microsoft Assembler Command Line Options
  327.  
  328. ^MASM [options] srcfile[,[objfile][,[lstfile][,[xreffile]]]][;]
  329.  
  330. %Options                Definition
  331.  /A          generate segments in alphabetical order
  332.  /B[size]    sets I/O buffer size in K bytes (1..63, default 32)
  333.  /C          generate cross reference file with .CRF extension
  334.  /D          generate PASS 1 listing
  335.  /Dsym[=val] define symbol for use during assembly
  336.  /E          emulate floating point instructions (for use with HLL)
  337.  /H          list options and command syntax
  338.  /Ipath      include-file search path
  339.  /L          generate listing file with .LST extension
  340.  /ML         case sensitive for all symbols
  341.  /MU         upper case all symbols (default)
  342.  /MX         case sensitive in external and public symbols
  343.  /N          suppress symbol tables in listings
  344.  /P          check for impure code in 286 and 386 protected
  345.              mode (invalid CS overrides)
  346.  /S          generate segments in the order they are found (default)
  347.  /T          terse message display; display errors only
  348.  /V          verbose message display; includes # lines and symbols
  349.  /W{0|1|2}   assembly warning level
  350.                0 = no warnings
  351.                1 = severe warnings only
  352.                2 = all warnings enabled
  353.  /X          display complete conditional assembly blocks in
  354.              listing including false conditionals
  355.  /Z          display errors including line numbers to screen
  356.  /ZD         generate line numbers in .OBJ files
  357.  /ZI         generate both symbolic and line number information in
  358.              .OBJ files
  359.  
  360. %Environment Variables
  361.  
  362.  INCLUDE     search path for include files
  363.  MASM        default command line options
  364. :ea:effective addr calc
  365. ^8088/8086  Effective Address (EA) Calculation
  366.  
  367. %                Description                  Clock Cycles
  368.  
  369.  Displacement                                       6
  370.  Base or Index (BX,BP,SI,DI)                        5
  371.  Displacement+(Base or Index)                       9
  372.  Base+Index (BP+DI,BX+SI)                           7
  373.  Base+Index (BP+SI,BX+DI)                           8
  374.  Base+Index+Displacement (BP+DI,BX+SI)             11
  375.  Base+Index+Displacement (BP+SI+disp,BX+DI+disp)   12
  376.  
  377.  
  378.  - add 4 cycles for word operands at odd addresses
  379.  - add 2 cycles for segment override
  380.  - 80188/80186 timings differ from those of the 8088/8086/80286
  381.  
  382. :flags register:8086 flags
  383. ^FLAGS - Intel 8086 Family Flags Register
  384.  
  385.  │11│10│F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│
  386.    │  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───  CF Carry Flag
  387.    │  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───  1
  388.    │  │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───  PF Parity Flag
  389.    │  │ │ │ │ │ │ │ │ │ │ │ │ │ └───  0
  390.    │  │ │ │ │ │ │ │ │ │ │ │ │ └───  AF Auxiliary Flag
  391.    │  │ │ │ │ │ │ │ │ │ │ │ └───  0
  392.    │  │ │ │ │ │ │ │ │ │ │ └───  ZF Zero Flag
  393.    │  │ │ │ │ │ │ │ │ │ └───  SF Sign Flag
  394.    │  │ │ │ │ │ │ │ │ └───  TF Trap Flag  (Single Step)
  395.    │  │ │ │ │ │ │ │ └───  IF Interrupt Flag
  396.    │  │ │ │ │ │ │ └───  DF Direction Flag
  397.    │  │ │ │ │ │ └───  OF Overflow flag
  398.    │  │ │ │ └─┴───  IOPL I/O Privilege Level  (286+)
  399.    │  │ │ └─────  NT Nested Task Flag  (286+)
  400.    │  │ └─────  0
  401.    │  └─────  RF Resume Flag (386)
  402.    └──────  VM  Virtual Mode Flag (386)
  403.  
  404.  - see   PUSHF   POPF   STI   CLI   STD   CLD
  405. :models:segment names
  406. ^Memory Model Programming & Segment Information
  407.  
  408. %Model
  409.  TINY          Data and code fit in one 64K segment.  All code and
  410.                data are accessed via near pointers.
  411.  SMALL         64k data segment max and 64k code segment max.  All
  412.                code and data are accessed via near pointers.
  413.  COMPACT       1Mb data segment max and 64K code segment max.  Code
  414.                is accessed via near pointers, data is accessed via
  415.                far pointers.  No array can be greater than 64K
  416.  MEDIUM        64K data segment max and 1Mb code segment max.  Code
  417.                is accessed via far pointers, data is accessed via
  418.                near pointers.
  419.  LARGE         1Mb data segment max and 1Mb code segment max.  All
  420.                code and data are accessed via far pointers.  No
  421.                single element can be greater than 64K.
  422.  HUGE          1Mb data segment max and 1Mb code segment max.  All
  423.                code and data are accessed via far pointers.  This is
  424.                the only model where arrays can be larger than 64K.
  425.                In this mode is C will normalize all data pointers
  426.                to avoid segment wrapping.
  427.  
  428. ^Small Memory Model
  429.  
  430. %Directive   Segment    Alignment   Combine     Class
  431.  .CODE        _TEXT       WORD      PUBLIC      'CODE'
  432.  .DATA        _DATA       WORD      PUBLIC      'DATA'
  433.  .CONST       CONST       WORD      PUBLIC      'CONST'
  434.  .DATA?       _BSS        WORD      PUBLIC      'BSS'
  435.  .STACK       STACK       PARA      STACK       'STACK'
  436.  
  437.  
  438. ^Compact Memory Model
  439.  
  440. %Directive   Segment    Alignment   Combine     Class
  441.  .CODE        _TEXT       WORD      PUBLIC      'CODE'
  442.  .FARDATA    FAR_DATA     PARA      private     'FAR_DATA'
  443.  .FARDATA?   FAR_BSS      PARA      private     'FAR_BSS'
  444.  .DATA        _DATA       WORD      PUBLIC      'DATA'
  445.  .CONST       CONST       WORD      PUBLIC      'CONST'
  446.  .DATA?       _BSS        WORD      PUBLIC      'BSS'
  447.  .STACK       STACK       PARA      STACK       'STACK'
  448.  
  449.  
  450. ^Medium Memory Model
  451.  
  452. %Directive   Segment    Alignment   Combine     Class
  453.  .CODE      name_TEXT     WORD      PUBLIC      'CODE'
  454.  .DATA        _DATA       WORD      PUBLIC      'DATA'
  455.  .CONST       CONST       WORD      PUBLIC      'CONST'
  456.  .DATA?       _BSS        WORD      PUBLIC      'BSS'
  457.  .STACK       STACK       PARA      STACK       'STACK'
  458.  
  459.  
  460. ^Large or Huge Memory Models
  461.  
  462. %Directive   Segment    Alignment   Combine     Class
  463.  .CODE      name_TEXT     WORD      PUBLIC      'CODE'
  464.  .FARDATA    FAR_DATA     PARA      private     'FAR_DATA'
  465.  .FARDATA?   FAR_BSS      PARA      private     'FAR_BSS'
  466.  .DATA        _DATA       WORD      PUBLIC      'DATA'
  467.  .CONST       CONST       WORD      PUBLIC      'CONST'
  468.  .DATA?       _BSS        WORD      PUBLIC      'BSS'
  469.  .STACK       STACK       PARA      STACK       'STACK'
  470.  
  471.  
  472.  - all segments fall into DGROUP except for all ???_TEXT, FAR_DATA
  473.    and FAR_BSS segments
  474.  
  475. :msw:machine status word
  476. ^MSW - Machine Status Word (286/386)
  477.  
  478.  
  479.    │31│ 30-5 │4│3│2│1│0│  Machine Status Word
  480.      │    │   │ │ │ │ └──── Protection Enable (PE)
  481.      │    │   │ │ │ └───── Math Present (MP)
  482.      │    │   │ │ └────── Emulation (EM)
  483.      │    │   │ └─────── Task Switched (TS)
  484.      │    │   └──────── Extension Type (ET)
  485.      │    └─────────── Reserved
  486.      └─────────────── Paging (PG)
  487.  
  488.  
  489.  Bit 0   PE  Protection Enable, switches processor between
  490.              protected and real mode
  491.  Bit 1   MP  Math Present, controls function of the WAIT
  492.              instruction
  493.  Bit 2   EM  Emulation, indicates whether coprocessor functions
  494.              are to be emulated
  495.  Bit 3   TS  Task Switched, set and interrogated by coprocessor
  496.              on task switches and when interpretting coprocessor
  497.              instructions
  498.  Bit 4   ET  Extension Type, indicates type of coprocessor in
  499.              system
  500.  Bits 5-30   Reserved
  501.  bit 31  PG  Paging, indicates whether the processor uses page
  502.              tables to translate linear addresses to physical
  503.              addresses
  504.  
  505.  - see   SMSW   LMSW
  506. :aaa
  507. ^AAA - Ascii Adjust for Addition
  508.  
  509.  
  510.  Usage: AAA
  511.  Modifies flags: AF CF (OF,PF,SF,ZF undefined)
  512.  
  513.  
  514.  Changes contents of AL to valid unpacked decimal.   The high order
  515.  nibble is zeroed.
  516.  
  517.  
  518. %                          Clocks             Size
  519. %Operands              86/88  286  386       # Bytes
  520.  
  521.  none                    8     3    4           1
  522. :aad
  523. ^AAD - Ascii Adjust for Division
  524.  
  525.  
  526.  Usage: AAD
  527.  Modifies flags: SF ZF PF (AF,CF,OF undefined)
  528.  
  529.  
  530.  Used before dividing unpacked decimal numbers.   Multiplies AH by
  531.  10 and the adds result into AL.   Sets AH to zero.
  532.  
  533.  
  534. %                          Clocks             Size
  535. %Operands              86/88  286  386       # Bytes
  536.  
  537.  none                    60   14   19           2
  538. :aam
  539. ^AAM - Ascii Adjust for Multiplication
  540.  
  541.  
  542.  Usage: AAM
  543.  Modifies flags: PF SF ZF (AF,CF,OF undefined)
  544.  
  545.  
  546.  Used after multiplication of two unpacked decimal numbers, this
  547.  instruction adjusts an unpacked decimal number.   The high order
  548.  nibble of each byte must be zeroed before using this instruction.
  549.  
  550.  
  551. %                          Clocks             Size
  552. %Operands              86/88  286  386       # Bytes
  553.  
  554.  none                    83   16   17           2
  555. :aas
  556. ^AAS - Ascii Adjust for Subtraction
  557.  
  558.  
  559.  Usage: AAS
  560.  Modifies flags: AF CF (OF,PF,SF,ZF undefined)
  561.  
  562.  
  563.  Corrects result of a previous unpacked decimal subtraction in AL.
  564.  High order nibble is zeroed.
  565.  
  566.  
  567. %                          Clocks             Size
  568. %Operands              86/88  286  386       # Bytes
  569.  
  570.  none                     8    3    4           1
  571. :adc
  572. ^ADC - Add With Carry
  573.  
  574.  Usage: ADC  dest,src
  575.  Modifies flags: AF CF OF SF PF ZF
  576.  
  577.  
  578.  Sums two binary operands placing the result in the destination.
  579.  If CF is set, a 1 is added to the destination.
  580.  
  581.  
  582. %                          Clocks             Size
  583. %Operands              86/88  286  386       # Bytes
  584.  
  585.  reg,reg                 3     2    2           2
  586.  mem,reg               16+EA   7    7          2-4   (W88=24+EA)
  587.  reg,mem                9+EA   7    6          2-4   (W88=13+EA)
  588.  reg,immed               4     3    2          3-4
  589.  mem,immed             17+EA   7    7          3-6   (W88=23+EA)
  590.  accum,immed             4     3    2          2-3
  591.  
  592.  - see  EA for calculation of Effective Address "EA"
  593. :add
  594. ^ADD - Arithmetic Addition
  595.  
  596.  Usage: ADD  dest,src
  597.  Modifies flags: AF CF OF PF SF ZF
  598.  
  599.  
  600.  Adds "src" to "dest" and replacing the original contents of "dest".
  601.  Both operands are binary.
  602.  
  603.  
  604. %                          Clocks             Size
  605. %Operands              86/88  286  386       # Bytes
  606.  
  607.  reg,reg                 3     2    2           2
  608.  mem,reg               16+EA   7    7          2-4  (W88=24+EA)
  609.  reg,mem                9+EA   7    6          2-4  (W88=13+EA)
  610.  reg,immed               4     3    2          3-4
  611.  mem,immed             17+EA   7    7          3-6  (W88=23+EA)
  612.  accum,immed             4     3    2          2-3
  613.  
  614.  - see  EA for calculation of Effective Address "EA"
  615. :and
  616. ^AND - Logical And
  617.  
  618.  Usage: AND  dest,src
  619.  Modifies flags: CF OF PF SF ZF (AF undefined)
  620.  
  621.  
  622.  Performs a logical AND of the two operands replacing the destination
  623.  with the result.
  624.  
  625.  
  626. %                          Clocks             Size
  627. %Operands              86/88  286  386       # Bytes
  628.  
  629.  reg,reg                 3     2    2           2
  630.  mem,reg               16+EA   7    7          2-4  (W88=24+EA)
  631.  reg,mem                9+EA   7    6          2-4  (W88=13+EA)
  632.  reg,immed               4     3    2          3-4
  633.  mem,immed             17+EA   7    7          3-6  (W88=23+EA)
  634.  accum,immed             4     3    2          2-3
  635.  
  636.  - see  EA for calculation of Effective Address "EA"
  637. :arpl
  638. ^ARPL - Adjusted Requested Privilege Level of Selector
  639. ^(286/386 protected)
  640.  
  641.  
  642.  Usage: ARPL  dest,src
  643.  Modifies flags:    ZF
  644.  
  645.  
  646.  Compares the RPL bits of "dest" against "src".  If the RPL bits
  647.  of "dest" are less than "src", the destination RPL bits are set
  648.  equal to the source RPL bits and the Zero Flag is set.  Otherwise
  649.  the Zero Flag is cleared.
  650.  
  651.  
  652. %                          Clocks             Size
  653. %Operands              86/88  286  386       # Bytes
  654.  
  655.  reg,reg                 -    10   20           2
  656.  mem,reg                 -    11   21           4
  657. :bound
  658. ^BOUND - Array Index Bound Check (186/188/286/386)
  659.  
  660.  
  661.  Usage: BOUND  src,limit
  662.  Modifies flags: None
  663.  
  664.  
  665.  Array index in source register is checked against upper and lower
  666.  bounds in memory source.  The first word located at "limit" is
  667.  the lower boundary and the word at "limit+2" is the upper array bound.
  668.  Interrupt 5 occurs if the source value is less than or higher than
  669.  the source.
  670.  
  671.  
  672. %                           Clocks             Size
  673. %Operands              86/88  286   386       # Bytes
  674.  
  675.  reg16,mem32             -  noj=13 noj=10        2
  676.  reg32,mem64             -  noj=13 noj=10        2
  677. :bsf:bsr
  678. ^BSF/BSR - Bit Scan  (386 only)
  679.  
  680.  
  681.  Usage: BSF  dest,src
  682.         BSR  dest,src
  683.  Modifies flags: ZF
  684.  
  685.  
  686.  Scans source operand for first bit set.   Sets ZF if a bit is found
  687.  set and loads the destination with an index to first set bit.  Clears
  688.  ZF is no bits are found set.   BSF scans forward across bit pattern
  689.  (0-n) while BSR scans in reverse (n-0).
  690.  
  691.  
  692. %                           Clocks             Size
  693. %Operands              86/88  286   386       # Bytes
  694.  
  695.  reg,reg                 -     -   10+3n         3
  696.  reg,mem                 -     -   10+3n        3-7
  697. :bt
  698. ^BT - Bit Test  (386)
  699.  
  700.  
  701.  Usage: BT  dest,src
  702.  Modifies flags: CF
  703.  
  704.  
  705.  The destination bit indexed by the source value is copied into the
  706.  Carry Flag.
  707.  
  708.  
  709. %                           Clocks             Size
  710. %Operands              86/88  286   386       # Bytes
  711.  
  712.  reg16,immed8            -     -     3          4-8
  713.  mem16,immed8            -     -     6          4-8
  714.  reg16,reg16             -     -     3          3-7
  715.  mem16,reg16             -     -     12         3-7
  716. :btc
  717. ^BTC - Bit Test with Compliment  (386)
  718.  
  719.  
  720.  Usage: BTC  dest,src
  721.  Modifies flags: CF
  722.  
  723.  
  724.  The destination bit indexed by the source value is copied into the
  725.  Carry Flag after being complimented (inverted).
  726.  
  727.  
  728. %                           Clocks             Size
  729. %Operands              86/88  286   386       # Bytes
  730.  
  731.  reg16,immed8            -     -     6          4-8
  732.  mem16,immed8            -     -     8          4-8
  733.  reg16,reg16             -     -     6          3-7
  734.  mem16,reg16             -     -     13         3-7
  735. :btr
  736. ^BTR - Bit Test with Reset  (386)
  737.  
  738.  
  739.  Usage: BTR  dest,src
  740.  Modifies flags: CF
  741.  
  742.  
  743.  The destination bit indexed by the source value is copied into the
  744.  Carry Flag and then cleared in the destination.
  745.  
  746.  
  747. %                           Clocks             Size
  748. %Operands              86/88  286   386       # Bytes
  749.  
  750.  reg16,immed8            -     -     6          4-8
  751.  mem16,immed8            -     -     8          4-8
  752.  reg16,reg16             -     -     6          3-7
  753.  mem16,reg16             -     -     13         3-7
  754. :bts
  755. ^BTS - Bit Test and Set  (386)
  756.  
  757.  
  758.  Usage: BTS  dest,src
  759.  Modifies flags: CF
  760.  
  761.  
  762.  The destination bit indexed by the source value is copied into the
  763.  Carry Flag and then set in the destination.
  764.  
  765.  
  766. %                           Clocks             Size
  767. %Operands              86/88  286   386       # Bytes
  768.  
  769.  reg16,immed8            -     -     6          4-8
  770.  mem16,immed8            -     -     8          4-8
  771.  reg16,reg16             -     -     6          3-7
  772.  mem16,reg16             -     -     13         3-7
  773. :call
  774. ^CALL - Procedure Call
  775.  
  776.  Usage: CALL  proc-name
  777.  Modifies flags: None
  778.  
  779.  Pushes Instruction Pointer (and Code Segment for far calls) onto
  780.  stack and loads Instruction Pointer with the address of proc-name.
  781.  Code continues with execution at CS:IP.
  782.  
  783. %                            Clocks              Size
  784. %Operands             86/88    286    386       # Bytes
  785.  
  786.  near-proc            19/23    7+m    7+m          3
  787.  far-proc             28/36   13+m   17+m          5
  788.  reg                  16/20    7+m    7+m          2
  789.  mem16            21+EA/29+EA 11+m   10+m         2-4
  790.  mem32            37+EA/53+EA 16+m   22+m         2-4
  791.  
  792.  
  793.  - see  ASM  for information on calculation of "m"
  794.  - see  EA for calculation of Effective Address "EA"
  795. :cbw
  796. ^CBW - Convert Byte to Word
  797.  
  798.  
  799.  Usage: CBW
  800.  Modifies flags: None
  801.  
  802.  
  803.  Converts byte in AL to word Value in AX by extending sign of AL
  804.  throughout register AH.
  805.  
  806.  
  807. %                           Clocks             Size
  808. %Operands              86/88  286   386       # Bytes
  809.  
  810.  none                    2     2     3           1
  811. :cdq
  812. ^CDQ - Convert Double to Quad   (386 only)
  813.  
  814.  
  815.  Usage: CDQ
  816.  Modifies flags: None
  817.  
  818.  
  819.  Converts signed DWORD in EAX to a signed quad word in EDX:EAX by
  820.  extending the high order bit of EAX throughout EDX
  821.  
  822.  
  823. %                           Clocks             Size
  824. %Operands              86/88  286   386       # Bytes
  825.  
  826.  none                    -     -     2           1
  827. :clc
  828. ^CLC - Clear Carry
  829.  
  830.  
  831.  Usage: CLC
  832.  Modifies flags: CF
  833.  
  834.  
  835.  Clears the Carry Flag.
  836.  
  837.  
  838. %                           Clocks             Size
  839. %Operands              86/88  286   386       # Bytes
  840.  
  841.  none                    2     2     2           1
  842. :cld
  843. ^CLD - Clear Direction Flag
  844.  
  845.  
  846.  Usage: CLD
  847.  Modifies flags: DF
  848.  
  849.  
  850.  Clears the Direction Flag causing string instructions to increment
  851.  the SI and DI index registers.
  852.  
  853.  
  854. %                           Clocks             Size
  855. %Operands              86/88  286   386       # Bytes
  856.  
  857.  none                    2     2     2           1
  858. :cli
  859. ^CLI - Clear Interrupt Flag (disable)
  860.  
  861.  
  862.  Usage: CLI
  863.  Modifies flags: IF
  864.  
  865.  
  866.  Disables the maskable hardware interrupts by clearing the Interrupt
  867.  flag.  NMI's and software interrupts are not inhibited.
  868.  
  869.  
  870. %                           Clocks             Size
  871. %Operands              86/88  286   386       # Bytes
  872.  
  873.  none                    2     2     3           1
  874. :clts
  875. ^CLTS - Clear Task Switched Flag  (286/386 privileged)
  876.  
  877.  
  878.  Usage: CLTS
  879.  Modifies flags: None
  880.  
  881.  
  882.  Clears the Task Switched Flag in the Machine Status Register.  This
  883.  is a privileged operation and is generally used only by operating
  884.  system code.
  885.  
  886.  
  887. %                           Clocks             Size
  888. %Operands              86/88  286   386       # Bytes
  889.  
  890.  none                    -     2     5           2
  891. :cmc
  892. ^CMC - Complement Carry Flag
  893.  
  894.  
  895.  Usage: CMC
  896.  Modifies flags: CF
  897.  
  898.  
  899.  Toggles (inverts) the Carry Flag
  900.  
  901.  
  902. %                           Clocks             Size
  903. %Operands              86/88  286   386       # Bytes
  904.  
  905.  none                    2     2     2           1
  906. :cmp
  907. ^CMP - Compare
  908.  
  909.  Usage: CMP  dest,src
  910.  Modifies flags: AF CF OF PF SF ZF
  911.  
  912.  
  913.  Subtracts source from destination and updates the flags but does
  914.  not save result.   Flags can subsequently be checked for conditions.
  915.  
  916.  
  917. %                           Clocks             Size
  918. %Operands              86/88  286   386       # Bytes
  919.  
  920.  reg,reg                 3     2     2           2
  921.  mem,reg                9+EA   7     5          2-4   (W88=13+EA)
  922.  reg,mem                9+EA   6     6          2-4   (W88=13+EA)
  923.  reg,immed               4     3     2          3-4
  924.  mem,immed             10+EA   6     5          3-6   (W88=14+EA)
  925.  accum,immed             4     3     2          2-3
  926.  
  927.  - see  EA for calculation of Effective Address "EA"
  928. :cmps:cmpsb:cmpsw:cmpsd
  929. ^CMPS - Compare String (Byte, Word or Doubleword)
  930.  
  931.  Usage: CMPS  dest,src
  932.         CMPSB
  933.         CMPSW
  934.         CMPSD  (386 only)
  935.  Modifies flags: AF CF OF PF SF ZF
  936.  
  937.  Subtracts destination value from source without saving results.
  938.  Updates flags based on the subtraction and  the index registers
  939.  (E)SI and (E)DI are incremented or decremented depending on the
  940.  state of the Direction Flag.  CMPSB inc/decrements the index
  941.  registers by 1, CMPSW inc/decrements by 2, while CMPSD increments
  942.  or decrements by 4.   The REP prefixes can be used to process
  943.  entire data items.
  944.  
  945. %                           Clocks             Size
  946. %Operands              86/88  286   386       # Bytes
  947.  
  948.  dest,src               22     8    10           1   (W88=30)
  949. :cwd
  950. ^CWD - Convert Word to Doubleword
  951.  
  952.  
  953.  Usage: CWD
  954.  Modifies flags: None
  955.  
  956.  
  957.  Extends sign of word in register AX throughout register DX forming
  958.  a doubleword quantity in DX:AX.
  959.  
  960.  
  961. %                           Clocks             Size
  962. %Operands              86/88  286   386       # Bytes
  963.  
  964.  none                    5     2     2           1
  965. :cwde
  966. ^CWDE - Convert Word to Extended Doubleword  (386 only)
  967.  
  968.  
  969.  Usage: CWDE
  970.  Modifies flags: None
  971.  
  972.  
  973.  Converts a signed word in AX to a signed doubleword in EAX by
  974.  extending the sign bit of AX throughout  EAX.
  975.  
  976.  
  977. %                           Clocks             Size
  978. %Operands              86/88  286   386       # Bytes
  979.  
  980.  none                    -     -     3           1
  981. :daa
  982. ^DAA - Decimal Adjust for Addition
  983.  
  984.  
  985.  Usage: DAA
  986.  Modifies flags: AF CF PF SF ZF (OF undefined)
  987.  
  988.  
  989.  Corrects result (in AL) of a previous BCD addition operation.
  990.  Contents of AL are changed to a pair of packed decimal digits.
  991.  
  992.  
  993. %                           Clocks             Size
  994. %Operands              86/88  286   386       # Bytes
  995.  
  996.  none                    4     3     4           1
  997. :das
  998. ^DAS - Decimal Adjust for Subtraction
  999.  
  1000.  
  1001.  Usage: DAS
  1002.  Modifies flags: AF CF PF SF ZF (OF undefined)
  1003.  
  1004.  
  1005.  Corrects result (in AL) of a previous BCD subtraction operation.
  1006.  Contents of AL are changed to a pair of packed decimal digits.
  1007.  
  1008.  
  1009. %                           Clocks             Size
  1010. %Operands              86/88  286   386       # Bytes
  1011.  
  1012.  none                    4     3     4           1
  1013. :dec
  1014. ^DEC - Decrement
  1015.  
  1016.  
  1017.  Usage: DEC  dest
  1018.  Modifies flags: AF OF PF SF ZF
  1019.  
  1020.  
  1021.  Unsigned binary subtraction of one from the destination.
  1022.  
  1023.  
  1024. %                           Clocks             Size
  1025. %Operands              86/88  286   386       # Bytes
  1026.  
  1027.  reg8                    3     2     2           2
  1028.  mem                   15+EA   7     6          2-4
  1029.  reg16/32                3     2     2           1
  1030.  
  1031.  - see  EA for calculation of Effective Address "EA"
  1032. :div
  1033. ^DIV - Divide
  1034.  
  1035.  Usage: DIV  src
  1036.  Modifies flags: (AF,CF,OF,PF,SF,ZF undefined)
  1037.  
  1038.  Unsigned binary division of accumulator by source.  If the source
  1039.  divisor is a byte value then AX is divided by "src" and the quotient
  1040.  is placed in AL and the remainder in AH.  If source operand is a word
  1041.  value, then DX:AX is divided by "src" and the quotient is stored in AX
  1042.  and the remainder in DX.
  1043.  
  1044. %                           Clocks             Size
  1045. %Operands            86/88    286    386       # Bytes
  1046.  
  1047.  reg8                80-90    14     14           2
  1048.  reg16              144-162   22     22           2
  1049.  reg32                 -       -     38           2
  1050.  mem8             (86-96)+EA  17     17          2-4
  1051.  mem16           (150-168)+EA 25     25          2-4  (W88=158-176+EA)
  1052.  mem32                 -       -     41          2-4
  1053.  
  1054.  - see  EA for calculation of Effective Address "EA"
  1055. :enter
  1056. ^ENTER - Make Stack Frame  (188/186/286/386)
  1057.  
  1058.  
  1059.  Usage: ENTER  locals,level
  1060.  Modifies flags: None
  1061.  
  1062.  
  1063.  Modifies stack for entry to procedure for high level language.
  1064.  Operand "locals" specifies the amount of storage to be allocated
  1065.  on the stack.   "Level" specifies the nesting level of the routine.
  1066.  Paired with the LEAVE instruction, this is an efficient method of
  1067.  entry and exit to procedures.
  1068.  
  1069.  
  1070. %                            Clocks               Size
  1071. %Operands             86/88    286     386       # Bytes
  1072.  
  1073.  immed16,0              -      11      10           4
  1074.  immed16,1              -      15      12           4
  1075.  immed16,immed8         - 12+4(n-1) 15+4(n-1)       4
  1076. :esc
  1077. ^ESC - Escape
  1078.  
  1079.  
  1080.  Usage: ESC  immed,src
  1081.  Modifies flags: None
  1082.  
  1083.  
  1084.  Provides access to the data bus for other resident processors.
  1085.  The CPU treats it as a NOP but places memory operand on bus.
  1086.  
  1087.  
  1088. %                           Clocks             Size
  1089. %Operands              86/88  286   386       # Bytes
  1090.  
  1091.  immed,reg               2   9-20    ?           2
  1092.  immed,mem               2   9-20    ?          2-4
  1093. :hlt
  1094. ^HLT - Halt CPU
  1095.  
  1096.  
  1097.  Usage:  HLT
  1098.  Modifies flags: None
  1099.  
  1100.  
  1101.  Halts CPU until RESET line activated, NMI or maskable interrupt
  1102.  received.   The CPU becomes dormant but retains the current CS:IP
  1103.  for later restart.
  1104.  
  1105.  
  1106. %                           Clocks             Size
  1107. %Operands              86/88  286   386       # Bytes
  1108.  
  1109.  none                    2     2     5          1
  1110. :idiv
  1111. ^IDIV - Divide
  1112.  
  1113.  Usage:  IDIV src
  1114.  Modifies flags: (AF,CF,OF,PF,SF,ZF undefined)
  1115.  
  1116.  Signed binary division of accumulator by source.  If source is a
  1117.  byte value, AX is divided by "src" and the quotient is stored in
  1118.  AL and the remainder in AH.  If source is a word value, DX:AX is
  1119.  divided by "src", and the quotient is stored in AL and the
  1120.  remainder in DX.
  1121.  
  1122. %                           Clocks             Size
  1123. %Operands            86/88    286    386       # Bytes
  1124.  
  1125.  reg8               101-112    17    19           2
  1126.  reg16              165-184    25    27           2
  1127.  reg32                 -       -     43           2
  1128.  mem8            (107-118)+EA  20    22          2-4
  1129.  mem16           (171-190)+EA  38    30          2-4  (W88=175-194)
  1130.  mem32                 -       -     46          2-4
  1131.  
  1132.  - see  EA for calculation of Effective Address "EA"
  1133. :imul
  1134. ^IMUL - Signed Multiply
  1135.  
  1136.  Usage: IMUL  src
  1137.         IMUL  src,immed  (286/386)
  1138.         IMUL  dest,src,immed8  (286/386)
  1139.         IMUL  dest,src  (386)
  1140.  Modifies flags: CF OF (AF,PF,SF,ZF undefined)
  1141.  
  1142.  
  1143.  Signed multiplication of accumulator by "src" with result placed
  1144.  in the accumulator.   If the source operand is a byte value, it
  1145.  is multiplied by AL and the result stored in AX.   If the source
  1146.  operand is a word value it is multiplied by AX and the result is
  1147.  stored in DX:AX.  Other variation of this instruction allow
  1148.  specification of source and destination registers as well as a
  1149.  third immediate factor.
  1150.  
  1151. %                           Clocks             Size
  1152. %Operands              86/88  286   386       # Bytes
  1153.  
  1154.  reg8                  80-98   13   9-14         2
  1155.  reg16                128-154  21   9-22         2
  1156.  reg32                   -     -    9-38         2
  1157.  mem8                  86-104  16  12-17        2-4
  1158.  mem16                134-160  24  12-25        2-4
  1159.  mem32                   -     -   12-41        2-4
  1160.  reg8,immed  *           -     21   9-14         3
  1161.  reg16,immed             -     21   9-22         3
  1162.  reg32,immed             -     21   9-38        3-6
  1163.  reg8,reg8,immed  *      -     2    9-14        3-6
  1164.  reg16,reg16,immed       -     2    9-22        3-6
  1165.  reg32,reg32,immed       -     21   9-38        3-6
  1166.  reg8,mem8,immed  *      -     24  12-17        3-6
  1167.  reg16,mem16,immed       -     24  12-25        3-6
  1168.  reg32,mem32,immed       -     24  12-41        3-6
  1169.  reg16,reg16             -     -    9-22        3-5
  1170.  reg32,reg32             -     -    9-38        3-5
  1171.  reg16,mem16             -     -   12-25        3-5
  1172.  reg32,mem32             -     -   12-41        3-5
  1173.  
  1174.  
  1175.  * Check your assembler guide for actual operand formats
  1176.  
  1177. :in
  1178. ^IN - Input Byte or Word From Port
  1179.  
  1180.  
  1181.  Usage: IN  accum,port
  1182.  Modifies flags: None
  1183.  
  1184.  
  1185.  A byte or word is read from "port" and placed in AL or AX
  1186.  respectively.   If the port number is in the range of 0-255
  1187.  it can be specified as an immediate, otherwise the port number
  1188.  must be specified in DX.   Valid port ranges on the PC are 0-1024,
  1189.  though values through 65535 may be specified and recognized by
  1190.  third party vendors and PS/2's.
  1191.  
  1192.  
  1193. %                           Clocks             Size
  1194. %Operands              86/88  286   386       # Bytes
  1195.  
  1196.  accum,immed8          10/14   5     12          2
  1197.  accum,DX               8/12   5     13          1
  1198. :inc
  1199. ^INC - Increment
  1200.  
  1201.  
  1202.  Usage: INC  dest
  1203.  Modifies flags: AF OF PF SF ZF
  1204.  
  1205.  
  1206.  Adds one to destination unsigned binary operand.
  1207.  
  1208.  
  1209. %                           Clocks             Size
  1210. %Operands              86/88  286   386       # Bytes
  1211.  
  1212.  reg8                    3     2     2           2
  1213.  reg16                   3     2     2           1
  1214.  reg32                   3     2     2           1
  1215.  mem                   15+EA   7     6          2-4  (W88=23+EA)
  1216.  
  1217.  - see  EA for calculation of Effective Address "EA"
  1218. :ins:insb:insw:insd
  1219. ^INS - Input String from Port  (188/186/286/386)
  1220.  
  1221.  
  1222.  Usage: INS  dest,port
  1223.         INSB
  1224.         INSW
  1225.         INSD  (386)
  1226.  Modifies flags: None
  1227.  
  1228.  Loads data from port to the destination ES:(E)DI  (even if a
  1229.  destination operand is supplied).  (E)DI is adjusted by the size
  1230.  of the operand and increased if the Direction Flag is cleared and
  1231.  decreased if the Direction Flag is set.   For INSB, INSW, INSD no
  1232.  operands are allowed and the size is determined by the mnemonic.
  1233.  
  1234.  
  1235. %                           Clocks             Size
  1236. %Operands              86/88  286   386       # Bytes
  1237.  
  1238.  dest,port               -     5     15          1
  1239.  none                    -     5     15          1
  1240. :int
  1241. ^INT - Interrupt
  1242.  
  1243.  
  1244.  Usage: INT  interrupt-type
  1245.  Modifies flags: TF IF
  1246.  
  1247.  Initiates a software interrupt by pushing the flags, clearing the
  1248.  Trap and Interrupt Flags, pushing CS followed by IP and loading
  1249.  CS:IP with the value found in the interrupt vector table.  Execution
  1250.  then begins at the location addressed by the new CS:IP
  1251.  
  1252.  
  1253. %                           Clocks             Size
  1254. %Operands              86/88  286   386       # Bytes
  1255.  
  1256.  immed8                51/71  23+m  33           1
  1257.  3  (constant)         52/72  23    33           2
  1258.  
  1259.  
  1260.  - see  ASM  for information on calculation of "m"
  1261. :into
  1262. ^INTO - Interrupt on Overflow
  1263.  
  1264.  
  1265.  Usage: INTO
  1266.  Modifies flags: IF TF
  1267.  
  1268.  
  1269.  If the Overflow Flag is set this instruction generates an INT 4
  1270.  which causes the code addressed by 0000:0010 to be executed.
  1271.  
  1272.  
  1273. %                           Clocks             Size
  1274. %Operands              86/88  286   386       # Bytes
  1275.  
  1276.  none                  53/73  24+m   35          1
  1277.          if no jump      4     3     3
  1278.  
  1279.  
  1280.  - see  ASM  for information on calculation of "m"
  1281. :iret:iretd
  1282. ^IRET/IRETD - Interrupt Return
  1283.  
  1284.  Usage: IRET
  1285.         IRETD   (386 only)
  1286.  Modifies flags: AF CF DF IF PF SF TF ZF
  1287.  
  1288.  Returns control to point of interruption by popping IP, CS
  1289.  and then the Flags from the stack and continues execution at
  1290.  this location.  CPU exception interrupts will return to the
  1291.  instruction that cause the exception because the CS:IP placed
  1292.  on the stack during the interrupt is the address of the offending
  1293.  instruction.
  1294.  
  1295.  
  1296. %                           Clocks             Size
  1297. %Operands              86/88  286   386       # Bytes
  1298.  
  1299.  iret                  32/44  17+m   22          1
  1300.  iretd                   -     -     22          1
  1301.  
  1302.  - see  ASM  for information on calculation of "m"
  1303. :j...
  1304. ^Jump Instructions Table
  1305.  
  1306. %Mnemonic              Meaning                    Jump Condition
  1307.  
  1308.    JA       Jump if Above                         CF=0 and ZF=0
  1309.    JAE      Jump if Above or Equal                CF=0
  1310.    JB       Jump if Below                         CF=1
  1311.    JBE      Jump if Below or Equal                CF=1 or ZF=1
  1312.    JC       Jump if Carry                         CF=1
  1313.    JCXZ     Jump if CX Zero                       CX=0
  1314.    JE       Jump if Equal                         ZF=1
  1315.    JG       Jump if Greater (signed)              ZF=0 and SF=OF
  1316.    JGE      Jump if Greater or Equal (signed)     SF=OF
  1317.    JL       Jump if Less (signed)                 SF != OF
  1318.    JLE      Jump if Less or Equal (signed)        ZF=1 or SF != OF
  1319.    JMP      Unconditional Jump                    unconditional
  1320.    JNA      Jump if Not Above                     CF=1 or ZF=1
  1321.    JNAE     Jump if Not Above or Equal            CF=1
  1322.    JNB      Jump if Not Below                     CF=0
  1323.    JNBE     Jump if Not Below or Equal            CF=0 and ZF=0
  1324.    JNC      Jump if Not Carry                     CF=0
  1325.    JNE      Jump if Not Equal                     ZF=0
  1326.    JNG      Jump if Not Greater (signed)          ZF=1 or SF != OF
  1327.    JNGE     Jump if Not Greater or Equal (signed) SF != OF
  1328.    JNL      Jump if Not Less (signed)             SF=OF
  1329.    JNLE     Jump if Not Less or Equal (signed)    ZF=0 and SF=OF
  1330.    JNO      Jump if Not Overflow (signed)         OF=0
  1331.    JNP      Jump if No Parity                     PF=0
  1332.    JNS      Jump if Not Signed (signed)           SF=0
  1333.    JNZ      Jump if Not Zero                      ZF=0
  1334.    JO       Jump if Overflow (signed)             OF=1
  1335.    JP       Jump if Parity                        PF=1
  1336.    JPE      Jump if Parity Even                   PF=1
  1337.    JPO      Jump if Parity Odd                    PF=0
  1338.    JS       Jump if Signed (signed)               SF=1
  1339.    JZ       Jump if Zero                          ZF=1
  1340.  
  1341. %                           Clocks             Size
  1342. %Operands              86/88  286   386       # Bytes
  1343.  
  1344.  Jx  label              16    7+m   7+m          2
  1345.      no jump             4     3     3
  1346.  Jx  near-label          -     -    7+m          4
  1347.  
  1348.  
  1349.  - see   JCXZ  and  JMP  for their respective timings
  1350.  - It's a good programming practice to organize code so the
  1351.    expected case is executed without a jump since the actual
  1352.    jump takes longer to execute than falling through the test.
  1353.  - see   FLAGS
  1354. :ja:jnbe
  1355. ^JA/JNBE - Jump Above / Jump Not Below or Equal
  1356.  
  1357.  
  1358.  Usage: JA/JNBE  label
  1359.  Modifies flags: None
  1360.  
  1361.  
  1362.  Causes execution to branch to "label" if the Carry Flag and Zero Flag
  1363.  are both clear.   Unsigned comparision.
  1364.  
  1365.  
  1366. %                           Clocks             Size
  1367. %Operands              86/88  286   386       # Bytes
  1368.  
  1369.  label                  16    7+m   7+m          2
  1370.      no jump             4     3     3
  1371.  label                   -     -    7+m          4
  1372.  
  1373.  - see  ASM  for information on calculation of "m"
  1374. :jae:jnb
  1375. ^JAE/JNB - Jump Above or Equal / Jump on Not Below
  1376.  
  1377.  
  1378.  Usage: JAE  label
  1379.         JNB  label
  1380.  Modifies flags: None
  1381.  
  1382.  
  1383.  Causes execution to branch to "label" if the Carry Flag is clear.
  1384.  Functionally similar to JNC.   Unsigned comparision.
  1385.  
  1386.  
  1387. %                           Clocks             Size
  1388. %Operands              86/88  286   386       # Bytes
  1389.  
  1390.  label                  16    7+m   7+m          2
  1391.      no jump             4     3     3
  1392.  label                   -     -    7+m          4
  1393.  
  1394.  - see  ASM  for information on calculation of "m"
  1395. :jb:jnae
  1396. ^JB/JNAE - Jump Below / Jump Not Above or Equal
  1397.  
  1398.  
  1399.  Usage: JB   label
  1400.         JNAE label
  1401.  Modifies flags: None
  1402.  
  1403.  
  1404.  Causes execution to branch to "label" if the Carry Flag is set.
  1405.  Functionally similar to JC.   Unsigned comparision.
  1406.  
  1407.  
  1408. %                           Clocks             Size
  1409. %Operands              86/88  286   386       # Bytes
  1410.  
  1411.  label                  16    7+m   7+m          2
  1412.      no jump             4     3     3
  1413.  near-label              -     -    7+m          4
  1414.  
  1415.  
  1416.  - see  ASM  for information on calculation of "m"
  1417. :jbe:jna
  1418. ^JBE/JNA - Jump Below or Equal / Jump Not Above
  1419.  
  1420.  
  1421.  Usage: JBE  label
  1422.         JNA  label
  1423.  Modifies flags: None
  1424.  
  1425.  
  1426.  Causes execution to branch to "label" if the Carry Flag or
  1427.  the Zero Flag is set.   Unsigned comparision.
  1428.  
  1429.  
  1430. %                           Clocks             Size
  1431. %Operands              86/88  286   386       # Bytes
  1432.  
  1433.  label                  16    7+m   7+m          2
  1434.      no jump             4     3     3
  1435.  near-label              -     -    7+m          4
  1436.  
  1437.  
  1438.  - see  ASM  for information on calculation of "m"
  1439. :jc
  1440. ^JC - Jump on Carry
  1441.  
  1442.  
  1443.  Usage: JC  label
  1444.  Modifies flags: None
  1445.  
  1446.  
  1447.  Causes execution to branch to "label" if the Carry Flag is set.
  1448.  Functionally similar to JB and JNAE.   Unsigned comparision.
  1449.  
  1450.  
  1451. %                           Clocks             Size
  1452. %Operands              86/88  286   386       # Bytes
  1453.  
  1454.  label                  16    7+m   7+m          2
  1455.      no jump             4     3     3
  1456.  near-label              -     -    7+m          4
  1457.  
  1458.  
  1459.  - see  ASM  for information on calculation of "m"
  1460. :jcxz:jecxz
  1461. ^JCXZ/JECXZ - Jump if Register (E)CX is Zero
  1462.  
  1463.  
  1464.  Usage: JCXZ  label
  1465.         JECXZ label (386 only)
  1466.  Modifies flags: None
  1467.  
  1468.  
  1469.  Causes execution to branch to "label" if register CX is zero.  Uses
  1470.  unsigned comparision.
  1471.  
  1472. %                           Clocks             Size
  1473. %Operands              86/88  286   386       # Bytes
  1474.  
  1475.  label                  18    8+m   9+m          2
  1476.      no jump             6     4     5
  1477.  
  1478.  
  1479.  - see  ASM  for information on calculation of "m"
  1480. :je:jz
  1481. ^JE/JZ - Jump Equal / Jump Zero
  1482.  
  1483.  
  1484.  Usage: JE  label
  1485.         JZ  label
  1486.  Modifies flags: None
  1487.  
  1488.  
  1489.  Causes execution to branch to "label" if the Zero Flag is set.  Uses
  1490.  unsigned comparision.
  1491.  
  1492. %                           Clocks             Size
  1493. %Operands              86/88  286   386       # Bytes
  1494.  
  1495.  label                  16    7+m   7+m          2
  1496.      no jump             4     3     3
  1497.  near-label              -     -    7+m          4
  1498.  
  1499.  
  1500.  - see  ASM  for information on calculation of "m"
  1501. :jg:jnle
  1502. ^JG/JNLE - Jump Greater / Jump Not Less or Equal
  1503.  
  1504.  
  1505.  Usage: JG   label
  1506.         JNLE label
  1507.  Modifies flags: None
  1508.  
  1509.  
  1510.  Causes execution to branch to "label" if the Zero Flag is clear or
  1511.  the Sign Flag equals the Overflow Flag.   Signed comparision.
  1512.  
  1513.  
  1514. %                           Clocks             Size
  1515. %Operands              86/88  286   386       # Bytes
  1516.  
  1517.  label                  16    7+m   7+m          2
  1518.      no jump             4     3     3
  1519.  near-label              -     -    7+m          4
  1520.  
  1521.  
  1522.  - see  ASM  for information on calculation of "m"
  1523. :jge:jnl
  1524. ^JGE/JNL - Jump Greater or Equal / Jump Not Less
  1525.  
  1526.  
  1527.  Usage: JGE  label
  1528.         JNL  label
  1529.  Modifies flags: None
  1530.  
  1531.  
  1532.  Causes execution to branch to "label" if the Sign Flag equals
  1533.  the Overflow Flag.   Signed comparision.
  1534.  
  1535.  
  1536. %                           Clocks             Size
  1537. %Operands              86/88  286   386       # Bytes
  1538.  
  1539.  label                  16    7+m   7+m          2
  1540.      no jump             4     3     3
  1541.  near-label              -     -    7+m          4
  1542.  
  1543.  
  1544.  - see  ASM  for information on calculation of "m"
  1545. :jl:jnge
  1546. ^JL/JNGE - Jump Less / Jump Not Greater or Equal
  1547.  
  1548.  
  1549.  Usage: JL    label
  1550.         JNGE  label
  1551.  Modifies flags: None
  1552.  
  1553.  
  1554.  Causes execution to branch to "label" if the Sign Flag is not equal
  1555.  to Overflow Flag.   Unsigned comparision.
  1556.  
  1557.  
  1558. %                           Clocks             Size
  1559. %Operands              86/88  286   386       # Bytes
  1560.  
  1561.  label                  16    7+m   7+m          2
  1562.      no jump             4     3     3
  1563.  near-label              -     -    7+m          4
  1564.  
  1565.  
  1566.  - see  ASM  for information on calculation of "m"
  1567. :jle:jng
  1568. ^JLE/JNG - Jump Less or Equal / Jump Not Greater
  1569.  
  1570.  
  1571.  Usage: JLE  label
  1572.         JNG  label
  1573.  Modifies flags: None
  1574.  
  1575.  
  1576.  Causes execution to branch to "label" if the Zero Flag is set or the
  1577.  Sign Flag is not equal to the Overflow Flag.   Signed comparision.
  1578.  
  1579.  
  1580. %                           Clocks             Size
  1581. %Operands              86/88  286   386       # Bytes
  1582.  
  1583.  label                  16    7+m   7+m          2
  1584.      no jump             4     3     3
  1585.  near-label              -     -    7+m          4
  1586.  
  1587.  
  1588.  - see  ASM  for information on calculation of "m"
  1589. :jmp
  1590. ^JMP - Unconditional Jump
  1591.  
  1592.  Usage: JMP  target
  1593.  Modifies flags: None
  1594.  
  1595.  Unconditionally transfers control to "label".  Jumps by default
  1596.  are within -32768 to 32767 bytes from the instruction following
  1597.  the jump.  NEAR and SHORT jumps cause the IP to be updated while FAR
  1598.  jumps cause CS and IP to be updated.
  1599.  
  1600. %                           Clocks             Size
  1601. %Operands              86/88  286   386       # Bytes
  1602.  
  1603.  short-label             15   7+m   7+m          2
  1604.  near-label              15   7+m   7+m          3 (or 5,7 on 386)
  1605.  far-label               15  11+m  12+m          5
  1606.  reg16                   11   7+m   7+m          2
  1607.  reg32                   -     -    7+m          2
  1608.  mem16                 18+EA 11+m  10+m          2
  1609.  mem32                   -     -   10+m          2
  1610.  mem32                 24+EA 15+m  12+m          2
  1611.  mem48                   -     -   12+m          2
  1612.  
  1613.  - see  ASM  for information on calculation of "m"
  1614.  - see  EA for calculation of Effective Address "EA"
  1615.  
  1616. :jnc
  1617. ^JNC - Jump Not Carry
  1618.  
  1619.  
  1620.  Usage: JNC  label
  1621.  Modifies flags: None
  1622.  
  1623.  
  1624.  Causes execution to branch to "label" if the Carry Flag is clear.
  1625.  Functionally similar to JAE or JNB.   Unsigned comparision.
  1626.  
  1627.  
  1628. %                           Clocks             Size
  1629. %Operands              86/88  286   386       # Bytes
  1630.  
  1631.  label                  16    7+m   7+m          2
  1632.      no jump             4     3     3
  1633.  near-label              -     -    7+m          4
  1634.  
  1635.  
  1636.  - see  ASM  for information on calculation of "m"
  1637. :jne:jnz
  1638. ^JNE/JNZ - Jump Not Equal / Jump Not Zero
  1639.  
  1640.  
  1641.  Usage: JNE  label
  1642.         JNZ  label
  1643.  Modifies flags: None
  1644.  
  1645.  
  1646.  Causes execution to branch to "label" if the Zero Flag is clear.
  1647.  Unsigned comparision.
  1648.  
  1649. %                           Clocks             Size
  1650. %Operands              86/88  286   386       # Bytes
  1651.  
  1652.  label                  16    7+m   7+m          2
  1653.      no jump             4     3     3
  1654.  near-label              -     -    7+m          4
  1655.  
  1656.  
  1657.  - see  ASM  for information on calculation of "m"
  1658. :jno
  1659. ^JNO - Jump Not Overflow
  1660.  
  1661.  
  1662.  Usage: JNO  label
  1663.  Modifies flags: None
  1664.  
  1665.  
  1666.  Causes execution to branch to "label" if the Overflow Flag is clear.
  1667.  Signed comparision.
  1668.  
  1669. %                           Clocks             Size
  1670. %Operands              86/88  286   386       # Bytes
  1671.  
  1672.  label                  16    7+m   7+m          2
  1673.      no jump             4     3     3
  1674.  near-label              -     -    7+m          4
  1675.  
  1676.  
  1677.  - see  ASM  for information on calculation of "m"
  1678. :jns
  1679. ^JNS - Jump Not Signed
  1680.  
  1681.  
  1682.  Usage: JNS  label
  1683.  Modifies flags: None
  1684.  
  1685.  
  1686.  Causes execution to branch to "label" if the Sign Flag is clear.
  1687.  Signed comparision.
  1688.  
  1689. %                           Clocks             Size
  1690. %Operands              86/88  286   386       # Bytes
  1691.  
  1692.  label                  16    7+m   7+m          2
  1693.      no jump             4     3     3
  1694.  near-label              -     -    7+m          4
  1695.  
  1696.  
  1697.  - see  ASM  for information on calculation of "m"
  1698. :jnp:jpo
  1699. ^JNP/JPO - Jump Not Parity / Jump Parity Odd
  1700.  
  1701.  
  1702.  Usage: JNP/JPO  label
  1703.  Modifies flags: None
  1704.  
  1705.  
  1706.  Causes execution to branch to "label" if the Parity Flag is clear.
  1707.  Unsigned comparision.
  1708.  
  1709. %                           Clocks             Size
  1710. %Operands              86/88  286   386       # Bytes
  1711.  
  1712.  label                  16    7+m   7+m          2
  1713.      no jump             4     3     3
  1714.  near-label              -     -    7+m          4
  1715.  
  1716.  
  1717.  - see  ASM  for information on calculation of "m"
  1718. :jo
  1719. ^JO - Jump on Overflow
  1720.  
  1721.  
  1722.  Usage: JO  label
  1723.  Modifies flags: None
  1724.  
  1725.  
  1726.  Causes execution to branch to "label" if the Overflow Flag is set.
  1727.  Signed comparision.
  1728.  
  1729. %                           Clocks             Size
  1730. %Operands              86/88  286   386       # Bytes
  1731.  
  1732.  label                  16    7+m   7+m          2
  1733.      no jump             4     3     3
  1734.  near-label              -     -    7+m          4
  1735.  
  1736.  
  1737.  - see  ASM  for information on calculation of "m"
  1738. :jp:jpe
  1739. ^JP/JPE - Jump on Parity / Jump on Parity Even
  1740.  
  1741.  
  1742.  Usage: JP/JPE  label
  1743.  Modifies flags: None
  1744.  
  1745.  
  1746.  Causes execution to branch to "label" if the Parity Flag is set.
  1747.  Unsigned comparision.
  1748.  
  1749. %                           Clocks             Size
  1750. %Operands              86/88  286   386       # Bytes
  1751.  
  1752.  label                  16    7+m   7+m          2
  1753.      no jump             4     3     3
  1754.  near-label              -     -    7+m          4
  1755.  
  1756.  
  1757.  - see  ASM  for information on calculation of "m"
  1758. :js
  1759. ^JS - Jump Signed
  1760.  
  1761.  
  1762.  Usage: JS  label
  1763.  Modifies flags: None
  1764.  
  1765.  
  1766.  Causes execution to branch to "label" if the Sign Flag is set.
  1767.  Signed comparision.
  1768.  
  1769. %                           Clocks             Size
  1770. %Operands              86/88  286   386       # Bytes
  1771.  
  1772.  label                  16    7+m   7+m          2
  1773.      no jump             4     3     3
  1774.  near-label              -     -    7+m          4
  1775.  
  1776.  
  1777.  - see  ASM  for information on calculation of "m"
  1778. :lahf
  1779. ^LAHF - Load Register AH From Flags
  1780.  
  1781.  
  1782.  Usage: LAHF
  1783.  
  1784.  Modifies flags: None
  1785.  
  1786.  Copies bits 0-7 of the flags register into AH.  This includes flags
  1787.  AF, CF, PF, SF and ZF other bits are undefined.
  1788.  
  1789.  
  1790. %                           Clocks             Size
  1791. %Operands              86/88  286   386       # Bytes
  1792.  
  1793.  none                    4     2     2           1
  1794. :lar
  1795. ^LAR - Load Access Rights  (286/386 protected)
  1796.  
  1797.  
  1798.  Usage: LAR  dest,src
  1799.  Modifies flags: ZF
  1800.  
  1801.  
  1802.  The high byte of the of the destination register is overwritten by
  1803.  the value of the access rights byte and the low order byte is zeroed
  1804.  depending on the selection in the source operand.   The Zero Flag is
  1805.  set if the load operation is successful.
  1806.  
  1807.  
  1808. %                           Clocks             Size
  1809. %Operands              86/88  286   386       # Bytes
  1810.  
  1811.  reg16,reg16             -     14    15          3
  1812.  reg32,reg32             -     -     15          3
  1813.  reg16,mem16             -     16    16         3-7
  1814.  reg32,mem32             -     -     16         3-7
  1815. :lds
  1816. ^LDS - Load Pointer Using DS
  1817.  
  1818.  Usage: LDS  dest,src
  1819.  Modifies flags: None
  1820.  
  1821.  
  1822.  Loads 32-bit pointer from memory source to destination register
  1823.  and DS.  The offset is placed in the destination register and the
  1824.  segment is placed in DS.   To use this instruction the word at the
  1825.  lower memory address must contain the offset and the word at the
  1826.  higher address must contain the segment.  This simplifies the loading
  1827.  of far pointers from the stack and the interrupt vector table.
  1828.  
  1829.  
  1830. %                           Clocks             Size
  1831. %Operands              86/88  286   386       # Bytes
  1832.  
  1833.  reg16,mem32           16+EA   7     7          2-4
  1834.  
  1835.  - see  EA for calculation of Effective Address "EA"
  1836. :lea
  1837. ^LEA - Load Effective Address
  1838.  
  1839.  
  1840.  Usage: LEA  dest,src
  1841.  Modifies flags: None
  1842.  
  1843.  
  1844.  Transfers offset address of "src" to the destination register.
  1845.  
  1846.  
  1847. %                           Clocks             Size
  1848. %Operands              86/88  286   386       # Bytes
  1849.  
  1850.  reg,mem               2+EA    3     2          2-4
  1851.  
  1852.  - see  EA for calculation of Effective Address "EA"
  1853. :leave
  1854. ^LEAVE - Restore Stack for Procedure Exit (188/186/286/386)
  1855.  
  1856.  
  1857.  Usage: LEAVE
  1858.  Modifies flags: None
  1859.  
  1860.  
  1861.  Releases the local variables created by the previous ENTER
  1862.  instruction by restoring SP and BP to their condition before
  1863.  the procedure stack frame was initialized.
  1864.  
  1865.  
  1866. %                           Clocks             Size
  1867. %Operands              86/88  286   386       # Bytes
  1868.  
  1869.  none                    -     5     4           1
  1870. :les
  1871. ^LES - Load Pointer Using ES
  1872.  
  1873.  Usage: LES  dest,src
  1874.  Modifies flags: None
  1875.  
  1876.  
  1877.  Loads 32-bit pointer from memory source to destination register
  1878.  and ES.  The offset is placed in the destination register and the
  1879.  segment is placed in ES.   To use this instruction the word at the
  1880.  lower memory address must contain the offset and the word at the
  1881.  higher address must contain the segment.  This simplifies the loading
  1882.  of far pointers from the stack and the interrupt vector table.
  1883.  
  1884.  
  1885. %                           Clocks             Size
  1886. %Operands              86/88  286   386       # Bytes
  1887.  
  1888.  reg,mem         16+EA/24+EA   7     7          2-4
  1889.  
  1890.  - see  EA for calculation of Effective Address "EA"
  1891. :lfs
  1892. ^LFS - Load Pointer Using FS  (386 only)
  1893.  
  1894.  
  1895.  Usage: LFS  dest,src
  1896.  Modifies flags: None
  1897.  
  1898.  
  1899.  Loads 32-bit pointer from memory source to destination register
  1900.  and FS.  The offset is placed in the destination register and the
  1901.  segment is placed in FS.   To use this instruction the word at the
  1902.  lower memory address must contain the offset and the word at the
  1903.  higher address must contain the segment.  This simplifies the loading
  1904.  of far pointers from the stack and the interrupt vector table.
  1905.  
  1906.  
  1907. %                           Clocks             Size
  1908. %Operands              86/88  286   386       # Bytes
  1909.  
  1910.  reg,mem                 -     -     7          5-7
  1911. :lgdt
  1912. ^LGDT - Load Global Descriptor Table  (286/386 privileged)
  1913.  
  1914.  
  1915.  Usage: LGDT  src
  1916.  Modifies flags: None
  1917.  
  1918.  
  1919.  Loads a value from an operand into the Global Descriptor Table
  1920.  register.
  1921.  
  1922.  
  1923. %                           Clocks              Size
  1924. %Operands              86/88  286   386       # Bytes
  1925.  
  1926.  mem64                   -     11    11          5
  1927.  
  1928.  - see   GDT
  1929. :lidt
  1930. ^LIDT - Load Interrupt Descriptor Table  (286/386 privileged)
  1931.  
  1932.  
  1933.  Usage: LIDT  src
  1934.  Modifies flags: None
  1935.  
  1936.  
  1937.  Loads a value from an operand into the Interrupt Descriptor Table
  1938.  register.
  1939.  
  1940.  
  1941. %                           Clocks             Size
  1942. %Operands              86/88  286   386       # Bytes
  1943.  
  1944.  mem64                   -     12    11          5
  1945. :lgs
  1946. ^LGS - Load Pointer Using GS  (386 only)
  1947.  
  1948.  
  1949.  Usage: LGS  dest,src
  1950.  Modifies flags: None
  1951.  
  1952.  
  1953.  Loads 32-bit pointer from memory source to destination register
  1954.  and GS.  The offset is placed in the destination register and the
  1955.  segment is placed in GS.   To use this instruction the word at the
  1956.  lower memory address must contain the offset and the word at the
  1957.  higher address must contain the segment.  This simplifies the loading
  1958.  of far pointers from the stack and the interrupt vector table.
  1959.  
  1960.  
  1961. %                           Clocks              Size
  1962. %Operands              86/88  286   386       # Bytes
  1963.  
  1964.  reg,mem                 -     -     7          5-7
  1965. :lldt
  1966. ^LLDT - Load Local Descriptor Table  (286/386 privileged)
  1967.  
  1968.  
  1969.  Usage: LLDT  src
  1970.  Modifies flags: None
  1971.  
  1972.  
  1973.  Loads a value from an operand into the Local Descriptor Table
  1974.  register.
  1975.  
  1976.  
  1977. %                           Clocks              Size
  1978. %Operands              86/88  286   386       # Bytes
  1979.  
  1980.  reg16                   -     17    20          3
  1981.  mem16                   -     19    24          5
  1982.  
  1983. :lmsw
  1984. ^LMSW - Load Machine Status Word  (286/386 privileged)
  1985.  
  1986.  
  1987.  Usage: LMSW  src
  1988.  Modifies flags: None
  1989.  
  1990.  
  1991.  Loads the Machine Status Word from data found at "src"
  1992.  
  1993.  
  1994. %                           Clocks             Size
  1995. %Operands              86/88  286   386       # Bytes
  1996.  
  1997.  reg16                   -     3     10          3
  1998.  mem16                   -     6     13          5
  1999.  
  2000.  - see   MSW
  2001.  
  2002. :lsl
  2003. ^LSL - Load Segment Limit  (286/386 protected)
  2004.  
  2005.  
  2006.  Usage: LSL  dest,src
  2007.  Modifies flags: ZF
  2008.  
  2009.  Loads the segment limit of a selector into the destination register
  2010.  if the selector is valid and visible at the current privilege level.
  2011.  If loading is successful the Zero Flag is set, otherwise it is
  2012.  cleared.
  2013.  
  2014.  
  2015. %                           Clocks             Size
  2016. %Operands              86/88  286   386       # Bytes
  2017.  
  2018.  reg16,reg16             -     14  20/25         3
  2019.  reg32,reg32             -     -   20/25         3
  2020.  reg16,mem16             -     16  21/26         5
  2021.  reg32,mem32             -     -   21/26         5
  2022.  
  2023.  - 386 times are for byte granular/page granular
  2024. :lss
  2025. ^LSS - Load Pointer Using SS  (386 only)
  2026.  
  2027.  
  2028.  Usage: LSS  dest,src
  2029.  Modifies flags: None
  2030.  
  2031.  
  2032.  Loads 32-bit pointer from memory source to destination register
  2033.  and SS.  The offset is placed in the destination register and the
  2034.  segment is placed in SS.   To use this instruction the word at the
  2035.  lower memory address must contain the offset and the word at the
  2036.  higher address must contain the segment.  This simplifies the loading
  2037.  of far pointers from the stack and the interrupt vector table.
  2038.  
  2039.  
  2040. %                           Clocks             Size
  2041. %Operands              86/88  286   386       # Bytes
  2042.  
  2043.  reg,mem                 -     -     7          5-7
  2044. :lock
  2045. ^LOCK - Lock Bus
  2046.  
  2047.  
  2048.  Usage: LOCK
  2049.         LOCK: (386 prefix)
  2050.  Modifies flags: None
  2051.  
  2052.  
  2053.  This instruction is a prefix that causes the CPU assert bus lock
  2054.  signal during the execution of the next instruction.   Used to
  2055.  avoid two processors from updating the same data location.  The
  2056.  286 always asserts lock during an XCHG with memory operands.  This
  2057.  should only be used to lock the bus prior to XCHG, MOV, IN and
  2058.  OUT instructions.
  2059.  
  2060.  
  2061. %                           Clocks             Size
  2062. %Operands              86/88  286   386       # Bytes
  2063.  
  2064.  none                    2     0     0           1
  2065. :lods:lodsb:lodsw:lodsd
  2066. ^LODS - Load String (Byte, Word or Double)
  2067.  
  2068.  
  2069.  Usage: LODS  src
  2070.         LODSB
  2071.         LODSW
  2072.         LODSD  (386)
  2073.  Modifies flags: None
  2074.  
  2075.  Transfers string element addressed by DS:SI (even if an operand is
  2076.  supplied) to the accumulator.   SI is incremented based on the size
  2077.  of the operand or based on the instruction used.  If the Direction
  2078.  Flag is set SI is decremented, if the Direction Flag is clear SI
  2079.  is incremented.  Use with REP prefixes.
  2080.  
  2081.  
  2082. %                           Clocks             Size
  2083. %Operands              86/88  286   386       # Bytes
  2084.  
  2085.  src                   12/16   5     5           1
  2086. :loop
  2087. ^LOOP - Decrement CX and Loop if CX Not Zero
  2088.  
  2089.  
  2090.  Usage: LOOP  label
  2091.  Modifies flags: None
  2092.  
  2093.  
  2094.  Decrements CX by 1 and transfers control to "label" if CX is not
  2095.  Zero.  The "label" operand must be within -128 or 127 bytes of the
  2096.  instruction following the loop instruction
  2097.  
  2098.  
  2099. %                           Clocks             Size
  2100. %Operands              86/88  286   386       # Bytes
  2101.  
  2102.  label                   17   8+m   11+m         2
  2103.         no jump           5    4     ?
  2104.  
  2105.  
  2106.  - see  ASM  for information on calculation of "m"
  2107. :loope:loopz
  2108. ^LOOPE/LOOPZ - Loop While Equal / Loop While Zero
  2109.  
  2110.  
  2111.  Usage: LOOPE  label
  2112.         LOOPZ  label
  2113.  Modifies flags: None
  2114.  
  2115.  Decrements CX by 1 (without modifying the flags) and transfers
  2116.  control to "label" if CX != 0 and the Zero Flag is set.  The
  2117.  "label" operand must be within -128 or 127 bytes of the instruction
  2118.  following the loop instruction.
  2119.  
  2120.  
  2121. %                           Clocks             Size
  2122. %Operands              86/88  286   386       # Bytes
  2123.  
  2124.  label                   18   8+m   11+m         2
  2125.         no jump           6    4     ?
  2126.  
  2127.  
  2128.  - see  ASM  for information on calculation of "m"
  2129. :loopnz:loopne
  2130. ^LOOPNZ/LOOPNE - Loop While Not Zero / Loop While Not Equal
  2131.  
  2132.  
  2133.  Usage: LOOPNZ  label
  2134.         LOOPNE  label
  2135.  Modifies flags: None
  2136.  
  2137.  Decrements CX by 1 (without modifying the flags) and transfers
  2138.  control to "label" if CX != 0 and the Zero Flag is clear.  The
  2139.  "label" operand must be within -128 or 127 bytes of the instruction
  2140.  following the loop instruction.
  2141.  
  2142.  
  2143. %                           Clocks             Size
  2144. %Operands              86/88  286   386       # Bytes
  2145.  
  2146.  label                   19   8+m   11+m         2
  2147.         no jump           5    4     ?
  2148.  
  2149.  
  2150.  - see  ASM  for information on calculation of "m"
  2151. :ltr
  2152. ^LTR - Load Task Register   (286/386 privileged)
  2153.  
  2154.  
  2155.  Usage: LTR  src
  2156.  Modifies flags: None
  2157.  
  2158.  
  2159.  Loads the current task register with the value specified in "src".
  2160.  
  2161.  
  2162. %                           Clocks             Size
  2163. %Operands              86/88  286   386       # Bytes
  2164.  
  2165.  reg16                   -     17    23          3
  2166.  mem16                   -     19    27          5
  2167. :mov
  2168. ^MOV - Move Byte or Word
  2169.  
  2170.  Usage: MOV  dest,src
  2171.  Modifies flags: None
  2172.  
  2173.  Copies byte or word from the source operand to the destination
  2174.  operand.  If the destination is SS interrupts are disabled except
  2175.  on early buggy 808x CPUs.   Some CPUs disable interrupts if the
  2176.  destination is any of the segment registers
  2177.  
  2178. %                           Clocks             Size
  2179. %Operands              86/88  286   386       # Bytes
  2180.  
  2181.  reg,reg                 2     2     2           2
  2182.  mem,reg                9+EA   3     2          2-4   (W88=13+EA)
  2183.  reg,mem                8+EA   5     4          2-4   (W88=12+EA)
  2184.  mem,immed             10+EA   3     2          3-6   (W88=14+EA)
  2185.  reg,immed               4     2     2          2-3
  2186.  mem,accum              10     3     2           3    (W88=14)
  2187.  accum,mem              10     5     4           3    (W88=14)
  2188.  segreg,reg16            2     2     2           2
  2189.  segreg,mem16       8+EA/12+EA 5     5          2-4
  2190.  reg16,segreg            2     2     2           2
  2191.  mem16,segreg       9+EA/13+EA 3     2          2-4
  2192.  reg32,controlreg *      -     -     6           3
  2193.  controlreg,reg32 *      -     -  10/4/5         3
  2194.  reg32,debugreg   *      -     -   22/14         3
  2195.  debugreg,reg32   *      -     -   22/16         3
  2196.  reg32,testreg    *      -     -    12           3
  2197.  testreg,reg32    *      -     -    12           3
  2198.  
  2199.  * Indicates moves to or from general purpose registers to one of
  2200.    the following 386 special registers:
  2201.  
  2202.      controlreg is one of the following:  CR0,CR2,CR3
  2203.      debugreg is one of the following:  DR0, DR1, DR2, DR3, DR6, DR7
  2204.      testreg is one of the following:  TR6, TR7
  2205.  
  2206.  - see  EA for calculation of Effective Address "EA"
  2207. :movs:movsb:movsw:movsd
  2208. ^MOVS - Move String (Byte or Word)
  2209.  
  2210.  Usage: MOVS  dest,src
  2211.         MOVSB
  2212.         MOVSW
  2213.         MOVSD
  2214.  Modifies flags: None
  2215.  
  2216.  
  2217.  Copies data from addressed by DS:SI (even if operands are given) to
  2218.  the location ES:DI destination and updates SI and DI based on the
  2219.  size of the operand or instruction used.  SI and DI are incremented
  2220.  when the Direction Flag is cleared and decremented when the Direction
  2221.  Flag is Set.  Use with REP prefixes.
  2222.  
  2223.  
  2224. %                           Clocks             Size
  2225. %Operands              86/88  286   386       # Bytes
  2226.  
  2227.  dest,src                18    5     7           1   (W88=26)
  2228. :movsx
  2229. ^MOVSX - Move with Sign Extend  (386 only)
  2230.  
  2231.  
  2232.  Usage: MOVSX  dest,src
  2233.  Modifies flags: None
  2234.  
  2235.  
  2236.  Copies the value of the source operand to the destination register
  2237.  with the sign extended.
  2238.  
  2239.  
  2240. %                           Clocks             Size
  2241. %Operands              86/88  286   386       # Bytes
  2242.  
  2243.  reg,reg                 -     -     3           3
  2244.  reg,mem                 -     -     6          3-7
  2245. :movzx
  2246. ^MOVZX - Move with Zero Extend  (386 only)
  2247.  
  2248.  
  2249.  Usage: MOVZX  dest,src
  2250.  Modifies flags: None
  2251.  
  2252.  
  2253.  Copies the value of the source operand to the destination register
  2254.  with the zeroes extended.
  2255.  
  2256.  
  2257. %                           Clocks             Size
  2258. %Operands              86/88  286   386       # Bytes
  2259.  
  2260.  reg,reg                 -     -     3           3
  2261.  reg,mem                 -     -     6          3-7
  2262. :mul
  2263. ^MUL - Unsigned Multiply
  2264.  
  2265.  Usage: MUL  src
  2266.  Modifies flags: CF OF (AF,PF,SF,ZF undefined)
  2267.  
  2268.  Unsigned multiply of the accumulator by the source.  If "src" is
  2269.  a byte value, then AL is used as the other multiplicand and the
  2270.  result is placed in AX.   If "src" is a word value, then AX is
  2271.  multiplied by "src" and DX:AX receives the result.   If "src" is
  2272.  a double word value, then EAX is multiplied by "src" and EDX:EAX
  2273.  receives the result.  The 386 uses an early out algorithm which
  2274.  makes multiplying any size value in EAX as fast as in the 8 or 16
  2275.  bit registers.
  2276.  
  2277. %                            Clocks              Size
  2278. %Operands             86/88    286    386       # Bytes
  2279.  
  2280.  reg8                 70-77     13    9-14         2
  2281.  reg16               118-113    21    9-22         2
  2282.  reg32                  -       -     9-38        2-4
  2283.  mem8               76-83+EA    16   12-17        2-4
  2284.  mem16             124-139+EA   24   12-25        2-4
  2285.  mem32                  -       -    12-21        2-4
  2286.  
  2287.  - see  EA for calculation of Effective Address "EA"
  2288.  - see   IMUL
  2289. :neg
  2290. ^NEG - Two's Complement Negation
  2291.  
  2292.  
  2293.  Usage: NEG  dest
  2294.  Modifies flags: AF CF OF PF SF ZF
  2295.  
  2296.  
  2297.  Subtracts the destination from 0 and saves the 2s complement of
  2298.  "dest" back into "dest".
  2299.  
  2300.  
  2301. %                           Clocks             Size
  2302. %Operands              86/88  286   386       # Bytes
  2303.  
  2304.  reg                     3     2     2           2
  2305.  mem                   16+EA   7     6          2-4  (W88=24+EA)
  2306.  
  2307.  - see  EA for calculation of Effective Address "EA"
  2308. :nop
  2309. ^NOP - No Operation (90h)
  2310.  
  2311.  
  2312.  Usage: NOP
  2313.  Modifies flags: None
  2314.  
  2315.  
  2316.  This is a do nothing instruction.  It results in occupation of both
  2317.  space and time and is most useful for patching code segments.
  2318.  
  2319.  
  2320. %                           Clocks             Size
  2321. %Operands              86/88  286   386       # Bytes
  2322.  
  2323.  none                    3     3     3           1
  2324. :not
  2325. ^NOT - One's Compliment Negation (Logical NOT)
  2326.  
  2327.  
  2328.  Usage: NOT  dest
  2329.  Modifies flags: None
  2330.  
  2331.  Inverts the bits of the "dest" operand forming the 1s complement.
  2332.  
  2333.  
  2334. %                           Clocks             Size
  2335. %Operands              86/88  286   386       # Bytes
  2336.  
  2337.  reg                     3     2     2           2
  2338.  mem                   16+EA   7     6          2-4  (W88=24+EA)
  2339.  
  2340.  - see  EA for calculation of Effective Address "EA"
  2341. :or
  2342. ^OR - Inclusive Logical OR
  2343.  
  2344.  Usage: OR  dest,src
  2345.  Modifies flags: CF OF PF SF ZF (AF undefined)
  2346.  
  2347.  Logical inclusive OR of the two operands returning the result in
  2348.  the destination.   Any bit set in either operand will be set in the
  2349.  destination.
  2350.  
  2351. %                           Clocks             Size
  2352. %Operands              86/88  286   386       # Bytes
  2353.  
  2354.  reg,reg                 3     2     2           2
  2355.  mem,reg               16+EA   7     7          2-4  (W88=24+EA)
  2356.  reg,mem                9+EA   7     6          2-4  (W88=13+EA)
  2357.  reg,immed               4     3     2          3-4
  2358.  mem8,immed8           17+EA   7     7          3-6
  2359.  mem16,immed16         25+EA   7     7          3-6
  2360.  accum,immed             4     3     2          2-3
  2361.  
  2362.  - see  EA for calculation of Effective Address "EA"
  2363. :out
  2364. ^OUT - Output Data to Port
  2365.  
  2366.  
  2367.  Usage: OUT  port,accum
  2368.  Modifies flags: None
  2369.  
  2370.  Transfers byte in AL or word in AX to the specified hardware port
  2371.  address.  If the port number is in the range of 0-255 it can be
  2372.  specified as an immediate.  If greater than 255 then the port
  2373.  number must be specified in DX.   Since the PC only decodes 10 bits
  2374.  of the port address, values over 1023 can only be decoded by third
  2375.  party vendor equipment and also map to the port range 0-1023.
  2376.  
  2377.  
  2378. %                           Clocks             Size
  2379. %Operands              86/88  286   386       # Bytes
  2380.  
  2381.  immed8,accum          10/14   3     10          2
  2382.  DX,accum               8/12   3     11          1
  2383. :outs:outsb:outsw:outsd
  2384. ^OUTS - Output String to Port  (188/186/286/386)
  2385.  
  2386.  
  2387.  Usage: OUTS  port,src
  2388.         OUTSB
  2389.         OUTSW
  2390.         OUTSD  (386)
  2391.  Modifies flags: None
  2392.  
  2393.  
  2394.  Transfers a byte, word or doubleword from "src" to the hardware
  2395.  port specified in DX.  For instructions with no operands the "src"
  2396.  is located at DS:SI and SI is incremented or decremented by the
  2397.  size of the operand or the size dictated by the instruction format.
  2398.  When the Direction Flag is set SI is decremented, when clear, SI is
  2399.  incremented.   If the port number is in the range of 0-255 it can
  2400.  be specified as an immediate.  If greater than 255 then the port
  2401.  number must be specified in DX.   Since the PC only decodes 10 bits
  2402.  of the port address, values over 1023 can only be decoded by third
  2403.  party vendor equipment and also map to the port range 0-1023.
  2404.  
  2405.  
  2406. %                           Clocks             Size
  2407. %Operands              86/88  286   386       # Bytes
  2408.  
  2409.  port,src                -     5     14          1
  2410.  
  2411.  
  2412. :pop
  2413. ^POP - Pop Word off Stack
  2414.  
  2415.  
  2416.  Usage: POP  dest
  2417.  Modifies flags: None
  2418.  
  2419.  
  2420.  Transfers word at the current stack top (SS:SP) to the destination
  2421.  then increments SP by two to point to the new stack top.   CS is not
  2422.  a valid destination.
  2423.  
  2424.  
  2425. %                            Clocks              Size
  2426. %Operands              86/88   286    386       # Bytes
  2427.  
  2428.  reg16/32               8/12    5      4           1
  2429.  mem16/32           17+EA/25+EA 5      5          2-4
  2430.  segreg                 8/12    5      7           1
  2431.  
  2432.  - see  EA for calculation of Effective Address "EA"
  2433. :popa:popad
  2434. ^POPA/POPAD - Pop All Registers onto Stack  (188/186/286/386)
  2435.  
  2436.  
  2437.  Usage: POPA
  2438.         POPAD  (386)
  2439.  Modifies flags: None
  2440.  
  2441.  
  2442.  Pops the top 8 words off the stack into the 8 general purpose 16/32
  2443.  bit registers.   Registers are popped in the following order: (E)DI,
  2444.  (E)SI, (E)BP, (E)SP, (E)DX, (E)CX and (E)AX.  The (E)SP value popped
  2445.  from the stack is actually discarded.
  2446.  
  2447.  
  2448. %                           Clocks             Size
  2449. %Operands              86/88  286   386       # Bytes
  2450.  
  2451.  none                    -     19    24          1
  2452. :popf:popfd
  2453. ^POPF/POPFD - Pop Flags off Stack
  2454.  
  2455.  
  2456.  Usage: POPF
  2457.         POPFD  (386)
  2458.  Modifies flags: all flags
  2459.  
  2460.  
  2461.  Pops word/doubleword from stack into the Flags Register and then
  2462.  increments SP by 2 (for POPF) or 4 (for POPFD).
  2463.  
  2464.  
  2465. %                           Clocks             Size
  2466. %Operands              86/88  286   386       # Bytes
  2467.  
  2468.  none                   8/12   5     5           1
  2469. :push
  2470. ^PUSH - Push Word onto Stack
  2471.  
  2472.  Usage: PUSH  src
  2473.         PUSH  immed   (188/186/286/386)
  2474.  Modifies flags: None
  2475.  
  2476.  
  2477.  Decrements SP by the size of the operand (two or four, byte values
  2478.  are sign extended) and transfers one word from source to the stack
  2479.  top (SS:SP).
  2480.  
  2481. %                            Clocks              Size
  2482. %Operands              86/88   286    386       # Bytes
  2483.  
  2484.  reg16/32              11/15    3      2           1
  2485.  mem16/32           16+EA/24+EA 5      5          2-4
  2486.  segreg                10/14    3      2           1
  2487.  immed                   -      3      2          2-3
  2488.  
  2489.  - see  EA for calculation of Effective Address "EA"
  2490. :pusha:pushad
  2491. ^PUSHA/PUSHAD - Push All Registers onto Stack  (188/186/286/386)
  2492.  
  2493.  
  2494.  Usage: PUSHA
  2495.         PUSHAD  (386)
  2496.  Modifies flags: None
  2497.  
  2498.  
  2499.  Pushes all general purpose registers onto the stack in the following
  2500.  order: (E)AX, (E)CX, (E)DX, (E)BX, (E)SP, (E)BP, (E)SI, (E)DI.  The
  2501.  value of SP is the value before the actual push of SP.
  2502.  
  2503.  
  2504. %                           Clocks             Size
  2505. %Operands              86/88  286   386       # Bytes
  2506.  
  2507.  none                    -     17    18          1
  2508. :pushf:pushfd
  2509. ^PUSHF/PUSHFD - Push Flags onto Stack
  2510.  
  2511.  
  2512.  Usage: PUSHF
  2513.         PUSHFD  (386 only)
  2514.  Modifies flags: None
  2515.  
  2516.  
  2517.  Transfers the Flags Register onto the stack.   PUSHF saves a 16 bit
  2518.  value while PUSHFD saves a 32 bit value.
  2519.  
  2520.  
  2521. %                           Clocks             Size
  2522. %Operands              86/88  286   386       # Bytes
  2523.  
  2524.  none                  10/14   3     4           1
  2525. :rcl
  2526. ^RCL - Rotate Through Carry Left
  2527.  
  2528.  Usage: RCL  dest,count
  2529.  Modifies flags: CF OF
  2530.  
  2531.  
  2532.  Rotates the bits in the destination to the left "count" times with
  2533.  all data pushed out the left side re-entering on the right.  The
  2534.  Carry Flag holds the last bit rotated out.
  2535.  
  2536. %                           Clocks              Size
  2537. %Operands             86/88   286    386       # Bytes
  2538.  
  2539.  reg,1                  2      2      9           2
  2540.  mem,1                15+EA    7     10          2-4   (W88=23+EA)
  2541.  reg,CL                8+4n   5+n     9           2
  2542.  mem,CL              20+EA+4n 8+n    10          2-4   (W88=28+EA+4n)
  2543.  reg,immed8             -     5+n     9           3
  2544.  mem,immed8             -     8+n    10          3-5
  2545.  
  2546.  - see  EA for calculation of Effective Address "EA"
  2547. :rcr
  2548. ^RCL - Rotate Through Carry Right
  2549.  
  2550.  Usage: RCR  dest,count
  2551.  Modifies flags: CF OF
  2552.  
  2553.  
  2554.  Rotates the bits in the destination to the right "count" times with
  2555.  all data pushed out the right side re-entering on the left.  The
  2556.  Carry Flag holds the last bit rotated out.
  2557.  
  2558. %                           Clocks             Size
  2559. %Operands              86/88  286   386       # Bytes
  2560.  
  2561.  reg,1                  2      2      9           2
  2562.  mem,1                15+EA    7     10          2-4   (W88=23+EA)
  2563.  reg,CL                8+4n   5+n     9           2
  2564.  mem,CL              20+EA+4n 8+n    10          2-4   (W88=28+EA+4n)
  2565.  reg,immed8             -     5+n     9           3
  2566.  mem,immed8             -     8+n    10          3-5
  2567.  
  2568.  - see  EA for calculation of Effective Address "EA"
  2569. :rep
  2570. ^REP - Repeat String Operation
  2571.  
  2572.  
  2573.  Usage: REP
  2574.  Modifies flags: None
  2575.  
  2576.  
  2577.  Repeats execution of string instructions while CX != 0.   After
  2578.  each string operation, CX is decremented and the Zero Flag is
  2579.  tested.  The combination of a repeat prefix and a segment override
  2580.  on CPU's before the 386 may result in errors if an interrupt occurs
  2581.  before CX=0.  The following code shows code that is susceptible to
  2582.  this and how to avoid it:
  2583.  
  2584.   again:  rep movs  byte ptr ES:[DI],ES:[SI]   ; vulnerable instr.
  2585.               jcxz  next              ; continue if REP successful
  2586.               loop  again             ; interrupt goofed count
  2587.   next:
  2588.  
  2589. %                           Clocks             Size
  2590. %Operands              86/88  286   386       # Bytes
  2591.  
  2592.  none                    2     2     2           1
  2593. :repe:repz
  2594. ^REPE/REPZ - Repeat Equal / Repeat Zero
  2595.  
  2596.  
  2597.  Usage: REPE
  2598.         REPZ
  2599.  Modifies flags: None
  2600.  
  2601.  
  2602.  Repeats execution of string instructions while CX != 0 and the Zero
  2603.  Flag is set.   CX is decremented and the Zero Flag tested after
  2604.  each string operation.   The combination of a repeat prefix and a
  2605.  segment override on processors other than the 386 may result in
  2606.  errors if an interrupt occurs before CX=0.
  2607.  
  2608.  
  2609. %                           Clocks             Size
  2610. %Operands              86/88  286   386       # Bytes
  2611.  
  2612.  none                    2     2     2           1
  2613. :repne:repnz
  2614. ^REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero
  2615.  
  2616.  
  2617.  Usage: REPNE
  2618.         REPNZ
  2619.  Modifies flags: None
  2620.  
  2621.  
  2622.  Repeats execution of string instructions while CX != 0 and the Zero
  2623.  Flag is clear.   CX is decremented and the Zero Flag tested after
  2624.  each string operation.   The combination of a repeat prefix and a
  2625.  segment override on processors other than the 386 may result in
  2626.  errors if an interrupt occurs before CX=0.
  2627.  
  2628.  
  2629. %                           Clocks             Size
  2630. %Operands              86/88  286   386       # Bytes
  2631.  
  2632.  none                    2     2     2           1
  2633. :ret:retf:retn
  2634. ^RET/RETF - Return From Procedure
  2635.  
  2636.  Usage: RET  [n bytes]
  2637.         RETF [n bytes]
  2638.         RETN [n bytes]
  2639.  Modifies flags: None
  2640.  
  2641.  Transfers control from a procedure back to the instruction address
  2642.  saved on the stack.  "n bytes" is an optional number of bytes to
  2643.  release.   Far returns pop the IP followed by the CS, while near
  2644.  returns pop only the IP register.
  2645.  
  2646. %                           Clocks             Size
  2647. %Operands              86/88  286   386       # Bytes
  2648.  
  2649.  retn                  16/20 11+m 10+m           1
  2650.  retn immed8           20/24 11+m 10+m           3
  2651.  retf                  26/34 15+m 18+m           1
  2652.  retf immed8           25/33 15+m 18+m           3
  2653.  
  2654.  - see  ASM  for information on calculation of "m"
  2655. :rol
  2656. ^ROL - Rotate Left
  2657.  
  2658.  Usage: ROL  dest,count
  2659.  Modifies flags: CF OF
  2660.  
  2661.  
  2662.  Rotates the bits in the destination to the left "count" times with
  2663.  all data pushed out the left side re-entering on the right.  The
  2664.  Carry Flag will contain the value of the last bit rotated out.
  2665.  
  2666. %                           Clocks             Size
  2667. %Operands              86/88  286   386       # Bytes
  2668.  
  2669.  reg,1                   2     2     3           2
  2670.  mem,1                 15+EA   7     7          2-4  (W88=23+EA)
  2671.  reg,CL                 8+4n  5+n    3           2
  2672.  mem,CL              20+EA+4n 8+n    7          2-4  (W88=28+EA+4n)
  2673.  reg,immed8              -    5+n    3           3
  2674.  mem,immed8              -    8+n    7          3-5
  2675.  
  2676.  - see  EA for calculation of Effective Address "EA"
  2677. :ror
  2678. ^ROR - Rotate Right
  2679.  
  2680.  Usage: ROR  dest,count
  2681.  Modifies flags: CF OF
  2682.  
  2683.  
  2684.  Rotates the bits in the destination to the right "count" times with
  2685.  all data pushed out the right side re-entering on the left.   The
  2686.  Carry Flag will contain the value of the last bit rotated out.
  2687.  
  2688. %                           Clocks             Size
  2689. %Operands              86/88  286   386       # Bytes
  2690.  
  2691.  reg,1                   2     2     3           2
  2692.  mem,1                 15+EA   7     7          2-4  (W88=23+EA)
  2693.  reg,CL                 8+4n  5+n    3           2
  2694.  mem,CL              20+EA+4n 8+n    7          2-4  (W88=28+EA+4n)
  2695.  reg,immed8              -    5+n    3           3
  2696.  mem,immed8              -    8+n    7          3-5
  2697.  
  2698.  - see  EA for calculation of Effective Address "EA"
  2699. :sahf
  2700. ^SAHF - Store AH Register into FLAGS
  2701.  
  2702.  
  2703.  Usage: SAHF
  2704.  Modifies flags: AF CF PF SF ZF
  2705.  
  2706.  
  2707.  Transfers bits 0-7 of AH into the Flags Register.  This includes
  2708.  AF, CF, PF, SF and ZF.
  2709.  
  2710.  
  2711. %                           Clocks             Size
  2712. %Operands              86/88  286   386       # Bytes
  2713.  
  2714.  none                    4     2     3           1
  2715. :sal:shl
  2716. ^SAL/SHL - Shift Arithmetic Left / Shift Logical Left
  2717.  
  2718.  Usage: SAL  dest,count
  2719.         SHL  dest,count
  2720.  Modifies flags: CF OF PF SF ZF (AF undefined)
  2721.  
  2722.  
  2723.  Shifts the destination left by "count" bits with zeroes shifted
  2724.  in on right.   The Carry Flag contains the last bit shifted out.
  2725.  
  2726. %                           Clocks             Size
  2727. %Operands              86/88  286   386       # Bytes
  2728.  
  2729.  reg,1                   2     2     3           2
  2730.  mem,1                 15+EA   7     7          2-4   (W88=23+EA)
  2731.  reg,CL                 8+4n  5+n    3           2
  2732.  mem,CL              20+EA+4n 8+n    7          2-4   (W88=28+EA+4n)
  2733.  reg,immed8              -    5+n    3           3
  2734.  mem,immed8              -    8+n    7          3-5
  2735.  
  2736.  - see  EA for calculation of Effective Address "EA"
  2737. :sar
  2738. ^SAR - Shift Arithmetic Right
  2739.  
  2740.  Usage: SAR  dest,count
  2741.  Modifies flags: CF OF PF SF ZF (AF undefined)
  2742.  
  2743.  
  2744.  Shifts the destination right by "count" bits with the current sign
  2745.  bit replicated in the leftmost bit.  The Carry Flag contains the
  2746.  last bit shifted out.
  2747.  
  2748. %                           Clocks             Size
  2749. %Operands              86/88  286   386       # Bytes
  2750.  
  2751.  reg,1                   2     2     3           2
  2752.  mem,1                 15+EA   7     7          2-4  (W88=23+EA)
  2753.  reg,CL                 8+4n  5+n    3           2
  2754.  mem,CL              20+EA+4n 8+n    7          2-4  (W88=28+EA+4n)
  2755.  reg,immed8              -    5+n    3           3
  2756.  mem,immed8              -    8+n    7          3-5
  2757.  
  2758.  - see  EA for calculation of Effective Address "EA"
  2759. :sbb
  2760. ^SBB - Subtract with Borrow
  2761.  
  2762.  Usage: SBB  dest,src
  2763.  Modifies flags: AF CF OF PF SF ZF
  2764.  
  2765.  
  2766.  Subtracts the source from the destination, and subtracts 1 extra if
  2767.  the Carry Flag is set.   Results are returned in "dest".
  2768.  
  2769.  
  2770. %                           Clocks             Size
  2771. %Operands              86/88  286   386       # Bytes
  2772.  
  2773.  reg,reg                 3     2     2           2
  2774.  mem,reg               16+EA   7     6          2-4  (W88=24+EA)
  2775.  reg,mem                9+EA   7     7          2-4  (W88=13+EA)
  2776.  reg,immed               4     3     2          3-4
  2777.  mem,immed             17+EA   7     7          3-6  (W88=25+EA)
  2778.  accum,immed             4     3     2          2-3
  2779.  
  2780.  - see  EA for calculation of Effective Address "EA"
  2781. :scas:scasb:scasw:scasd
  2782. ^SCAS - Scan String  (Byte, Word or Doubleword)
  2783.  
  2784.  
  2785.  Usage: SCAS  string
  2786.         SCASB
  2787.         SCASW
  2788.         SCASD  (386)
  2789.  Modifies flags: AF CF OF PF SF ZF
  2790.  
  2791.  
  2792.  Compares value at ES:DI (even if operand is specified) from the
  2793.  accumulator and sets the flags similar to a subtraction.   DI is
  2794.  incremented/decremented based on the instruction format (or
  2795.  operand size) and the state of the Direction Flag.  Use with REP
  2796.  prefixes.
  2797.  
  2798. %                           Clocks             Size
  2799. %Operands              86/88  286   386       # Bytes
  2800.  
  2801.  string                  15    7     7           1   (W88=19)
  2802. :setae:setnb
  2803. ^SETAE/SETNB - Set if Above or Equal / Set if Not Below
  2804. ^(unsigned, 386)
  2805.  
  2806.  
  2807.  Usage: SETAE  dest
  2808.         SETNB  dest
  2809.  Modifies flags: none
  2810.  
  2811.  
  2812.  Sets the byte in the operand to 1 if the Carry Flag is clear
  2813.  otherwise sets the operand to 0.
  2814.  
  2815.  
  2816. %                           Clocks             Size
  2817. %Operands              86/88  286   386       # Bytes
  2818.  
  2819.  reg8                    -     -     4           3
  2820.  mem8                    -     -     5           3
  2821. :setb:setnae
  2822. ^SETB/SETNAE - Set if Below / Set if Not Above or Equal
  2823. ^(unsigned, 386)
  2824.  
  2825.  
  2826.  Usage: SETB   dest
  2827.         SETNAE dest
  2828.  Modifies flags: none
  2829.  
  2830.  
  2831.  Sets the byte in the operand to 1 if the Carry Flag is set
  2832.  otherwise sets the operand to 0.
  2833.  
  2834.  
  2835. %                           Clocks             Size
  2836. %Operands              86/88  286   386       # Bytes
  2837.  
  2838.  reg8                    -     -     4           3
  2839.  mem8                    -     -     5           3
  2840. :setbe:setna
  2841. ^SETBE/SETNA - Set if Below or Equal / Set if Not Above
  2842. ^(unsigned, 386)
  2843.  
  2844.  
  2845.  Usage: SETBE  dest
  2846.         SETNA  dest
  2847.  Modifies flags: none
  2848.  
  2849.  
  2850.  Sets the byte in the operand to 1 if the Carry Flag or the Zero
  2851.  Flag is set, otherwise sets the operand to 0.
  2852.  
  2853.  
  2854. %                           Clocks             Size
  2855. %Operands              86/88  286   386       # Bytes
  2856.  
  2857.  reg8                    -     -     4           3
  2858.  mem8                    -     -     5           3
  2859. :sete:setz
  2860. ^SETE/SETZ - Set if Equal / Set if Zero (386)
  2861.  
  2862.  
  2863.  Usage: SETE  dest
  2864.         SETZ  dest
  2865.  Modifies flags: none
  2866.  
  2867.  
  2868.  Sets the byte in the operand to 1 if the Zero Flag is set,
  2869.  otherwise sets the operand to 0.
  2870.  
  2871.  
  2872. %                           Clocks             Size
  2873. %Operands              86/88  286   386       # Bytes
  2874.  
  2875.  reg8                    -     -     4           3
  2876.  mem8                    -     -     5           3
  2877. :setne:setnz
  2878. ^SETNE/SETNZ - Set if Not Equal / Set if Not Zero (386)
  2879.  
  2880.  
  2881.  Usage: SETNE  dest
  2882.         SETNZ  dest
  2883.  Modifies flags: none
  2884.  
  2885.  
  2886.  Sets the byte in the operand to 1 if the Zero Flag is clear,
  2887.  otherwise sets the operand to 0.
  2888.  
  2889.  
  2890. %                           Clocks             Size
  2891. %Operands              86/88  286   386       # Bytes
  2892.  
  2893.  reg8                    -     -     4           3
  2894.  mem8                    -     -     5           3
  2895. :setl:setnge
  2896. ^SETL/SETNGE - Set if Less / Set if Not Greater or Equal
  2897. ^(signed, 386)
  2898.  
  2899.  
  2900.  Usage: SETL  dest
  2901.         SETNGE dest
  2902.  Modifies flags: none
  2903.  
  2904.  
  2905.  Sets the byte in the operand to 1 if the Sign Flag is not equal
  2906.  to the Overflow Flag, otherwise sets the operand to 0.
  2907.  
  2908.  
  2909. %                           Clocks             Size
  2910. %Operands              86/88  286   386       # Bytes
  2911.  
  2912.  reg8                    -     -     4           3
  2913.  mem8                    -     -     5           3
  2914. :setge:setnl
  2915. ^SETGE/SETNL - Set if Greater or Equal / Set if Not Less
  2916. ^(signed, 386)
  2917.  
  2918.  
  2919.  Usage: SETGE  dest
  2920.         SETNL  dest
  2921.  Modifies flags: none
  2922.  
  2923.  
  2924.  Sets the byte in the operand to 1 if the Sign Flag equals the
  2925.  Overflow Flag, otherwise sets the operand to 0.
  2926.  
  2927.  
  2928. %                           Clocks             Size
  2929. %Operands              86/88  286   386       # Bytes
  2930.  
  2931.  reg8                    -     -     4           3
  2932.  mem8                    -     -     5           3
  2933. :setle:setng
  2934. ^SETLE/SETNG - Set if Less or Equal / Set if Not greater or Equal
  2935. ^(signed, 386)
  2936.  
  2937.  
  2938.  Usage: SETLE  dest
  2939.         SETNG  dest
  2940.  Modifies flags: none
  2941.  
  2942.  
  2943.  Sets the byte in the operand to 1 if the Zero Flag is set or the
  2944.  Sign Flag is not equal to the Overflow Flag,  otherwise sets the
  2945.  operand to 0.
  2946.  
  2947.  
  2948. %                           Clocks             Size
  2949. %Operands              86/88  286   386       # Bytes
  2950.  
  2951.  reg8                    -     -     4           3
  2952.  mem8                    -     -     5           3
  2953. :setg:setnle
  2954. ^SETG/SETNLE - Set if Greater / Set if Not Less or Equal
  2955. ^(signed, 386)
  2956.  
  2957.  
  2958.  Usage: SETG  dest
  2959.         SETNLE  dest
  2960.  Modifies flags: none
  2961.  
  2962.  
  2963.  Sets the byte in the operand to 1 if the Zero Flag is clear or the
  2964.  Sign Flag equals to the Overflow Flag,  otherwise sets the operand
  2965.  to 0.
  2966.  
  2967.  
  2968. %                           Clocks             Size
  2969. %Operands              86/88  286   386       # Bytes
  2970.  
  2971.  reg8                    -     -     4           3
  2972.  mem8                    -     -     5           3
  2973. :sets
  2974. ^SETS - Set if Signed (386)
  2975.  
  2976.  
  2977.  Usage: SETS  dest
  2978.  Modifies flags: none
  2979.  
  2980.  
  2981.  Sets the byte in the operand to 1 if the Sign Flag is set, otherwise
  2982.  sets the operand to 0.
  2983.  
  2984.  
  2985. %                           Clocks             Size
  2986. %Operands              86/88  286   386       # Bytes
  2987.  
  2988.  reg8                    -     -     4           3
  2989.  mem8                    -     -     5           3
  2990. :setns
  2991. ^SETNS - Set if Not Signed (386)
  2992.  
  2993.  
  2994.  Usage: SETNS  dest
  2995.  Modifies flags: none
  2996.  
  2997.  
  2998.  Sets the byte in the operand to 1 if the Sign Flag is clear,
  2999.  otherwise sets the operand to 0.
  3000.  
  3001.  
  3002. %                           Clocks             Size
  3003. %Operands              86/88  286   386       # Bytes
  3004.  
  3005.  reg8                    -     -     4           3
  3006.  mem8                    -     -     5           3
  3007. :setc
  3008. ^SETC - Set if Carry (386)
  3009.  
  3010.  
  3011.  Usage: SETC  dest
  3012.  Modifies flags: none
  3013.  
  3014.  
  3015.  Sets the byte in the operand to 1 if the Carry Flag is set,
  3016.  otherwise sets the operand to 0.
  3017.  
  3018.  
  3019. %                           Clocks             Size
  3020. %Operands              86/88  286   386       # Bytes
  3021.  
  3022.  reg8                    -     -     4           3
  3023.  mem8                    -     -     5           3
  3024. :setnc
  3025. ^SETNC - Set if Not Carry (386)
  3026.  
  3027.  
  3028.  Usage: SETNC  dest
  3029.  Modifies flags: none
  3030.  
  3031.  
  3032.  Sets the byte in the operand to 1 if the Carry Flag is clear,
  3033.  otherwise sets the operand to 0.
  3034.  
  3035.  
  3036. %                           Clocks             Size
  3037. %Operands              86/88  286   386       # Bytes
  3038.  
  3039.  reg8                    -     -     4           3
  3040.  mem8                    -     -     5           3
  3041. :seto
  3042. ^SETO - Set if Overflow (386)
  3043.  
  3044.  
  3045.  Usage: SETO  dest
  3046.  Modifies flags: none
  3047.  
  3048.  
  3049.  Sets the byte in the operand to 1 if the Overflow Flag is set,
  3050.  otherwise sets the operand to 0.
  3051.  
  3052.  
  3053. %                           Clocks             Size
  3054. %Operands              86/88  286   386       # Bytes
  3055.  
  3056.  reg8                    -     -     4           3
  3057.  mem8                    -     -     5           3
  3058. :setno
  3059. ^SETNO - Set if Not Overflow (386)
  3060.  
  3061.  
  3062.  Usage: SETNO  dest
  3063.  Modifies flags: none
  3064.  
  3065.  
  3066.  Sets the byte in the operand to 1 if the Overflow Flag is clear,
  3067.  otherwise sets the operand to 0.
  3068.  
  3069.  
  3070. %                           Clocks             Size
  3071. %Operands              86/88  286   386       # Bytes
  3072.  
  3073.  reg8                    -     -     4           3
  3074.  mem8                    -     -     5           3
  3075. :setp:setpe
  3076. ^SETP/SETPE - Set if Parity / Set if Parity Even  (386)
  3077.  
  3078.  
  3079.  Usage: SETP  dest
  3080.         SETPE dest
  3081.  Modifies flags: none
  3082.  
  3083.  
  3084.  Sets the byte in the operand to 1 if the Parity Flag is set,
  3085.  otherwise sets the operand to 0.
  3086.  
  3087.  
  3088. %                           Clocks             Size
  3089. %Operands              86/88  286   386       # Bytes
  3090.  
  3091.  reg8                    -     -     4           3
  3092.  mem8                    -     -     5           3
  3093. :setnp:setpo
  3094. ^SETNP/SETPO - Set if No Parity / Set if Parity Odd (386)
  3095.  
  3096.  
  3097.  Usage: SETNP  dest
  3098.         SETPO  dest
  3099.  Modifies flags: none
  3100.  
  3101.  
  3102.  Sets the byte in the operand to 1 if the Parity Flag is clear,
  3103.  otherwise sets the operand to 0.
  3104.  
  3105.  
  3106. %                           Clocks             Size
  3107. %Operands              86/88  286   386       # Bytes
  3108.  
  3109.  reg8                    -     -     4           3
  3110.  mem8                    -     -     5           3
  3111. :sgdt
  3112. ^SGDT - Store Global Descriptor Table (286/386 privileged)
  3113.  
  3114.  
  3115.  Usage: SGDT  dest
  3116.  Modifies flags: none
  3117.  
  3118.  
  3119.  Stores the Global Descriptor Table Register into the specified
  3120.  operand.
  3121.  
  3122.  
  3123. %                           Clocks             Size
  3124. %Operands              86/88  286   386       # Bytes
  3125.  
  3126.  mem64                   -     11    9           5
  3127.  
  3128.  - see   GDT
  3129. :sidt
  3130. ^SIDT - Store Interrupt Descriptor Table (286/386 privileged)
  3131.  
  3132.  
  3133.  Usage: SIDT  dest
  3134.  Modifies flags: none
  3135.  
  3136.  
  3137.  Stores the Interrupt Descriptor Table Register into the specified
  3138.  operand.
  3139.  
  3140.  
  3141. %                           Clocks             Size
  3142. %Operands              86/88  286   386       # Bytes
  3143.  
  3144.  mem64                   -     12    9           5
  3145. :sldt
  3146. ^SLDT - Store Local Descriptor Table (286/386 privileged)
  3147.  
  3148.  
  3149.  Usage: SLDT  dest
  3150.  Modifies flags: none
  3151.  
  3152.  
  3153.  Stores the Local Descriptor Table Register into the specified
  3154.  operand.
  3155.  
  3156.  
  3157. %                           Clocks             Size
  3158. %Operands              86/88  286   386       # Bytes
  3159.  
  3160.  reg16                    -     2     2           3
  3161.  mem16                    -     2     2           5
  3162.  
  3163. :shr
  3164. ^SHR - Shift Logical Right
  3165.  
  3166.  Usage: SHR  dest,count
  3167.  Modifies flags: CF OF PF SF ZF (AF undefined)
  3168.  
  3169.  
  3170.  Shifts the destination right by "count" bits with zeroes shifted
  3171.  in on the left.   The Carry Flag contains the last bit shifted out.
  3172.  
  3173.  
  3174. %                           Clocks             Size
  3175. %Operands              86/88  286   386       # Bytes
  3176.  
  3177.  reg,1                   2     2     3           2
  3178.  mem,1                 15+EA   7     7          2-4   (W88=23+EA)
  3179.  reg,CL                 8+4n  5+n    3           2
  3180.  mem,CL              20+EA+4n 8+n    7          2-4   (W88=28+EA+4n)
  3181.  reg,immed8              -    5+n    3           3
  3182.  mem,immed8              -    8+n    7          3-5
  3183.  
  3184.  - see  EA for calculation of Effective Address "EA"
  3185. :shld:shrd
  3186. ^SHLD/SHRD - Double Precision Shift (386)
  3187.  
  3188.  
  3189.  Usage: SHLD  dest,src,count
  3190.         SHRD  dest,src,count
  3191.  Modifies flags: CF PF SF ZF (OF,AF undefined)
  3192.  
  3193.  
  3194.  SHLD shifts "dest" to the left "count" times and the bit positions
  3195.  opened are filled with the most significant bits of "src".   SHRD
  3196.  shifts "dest" to the right "count" times and the bit positions
  3197.  opened are filled with the least significant bits of the second
  3198.  operand.   Only the 5 lower bits of "count" are used.
  3199.  
  3200.  
  3201. %                           Clocks             Size
  3202. %Operands              86/88  286   386       # Bytes
  3203.  
  3204.  reg16,reg16,immed8      -     -     3           4
  3205.  reg32,reg32,immed8      -     -     3           4
  3206.  mem16,reg16,immed8      -     -     7           6
  3207.  mem32,reg32,immed8      -     -     7           6
  3208.  reg16,reg16,CL          -     -     3           3
  3209.  reg32,reg32,CL          -     -     3           3
  3210.  mem16,reg16,CL          -     -     7           5
  3211.  mem32,reg32,CL          -     -     7           5
  3212.  
  3213. :smsw
  3214. ^SMSW - Store Machine Status Word (286/386 privileged)
  3215.  
  3216.  
  3217.  Usage: SMSW  dest
  3218.  Modifies flags: none
  3219.  
  3220.  
  3221.  Store Machine Status Word into "dest".
  3222.  
  3223.  
  3224. %                           Clocks             Size
  3225. %Operands              86/88  286   386       # Bytes
  3226.  
  3227.  reg16                   -     2     10          3
  3228.  mem16                   -     3     3           5
  3229.  
  3230.  - see   MSW
  3231. :stc
  3232. ^STC - Set Carry
  3233.  
  3234.  
  3235.  Usage: STC
  3236.  Modifies flags: CF
  3237.  
  3238.  
  3239.  Sets the Carry Flag to 1.
  3240.  
  3241.  
  3242. %                           Clocks             Size
  3243. %Operands              86/88  286   386       # Bytes
  3244.  
  3245.  none                    2     2     2           1
  3246. :std
  3247. ^STD - Set Direction Flag
  3248.  
  3249.  
  3250.  Usage: STD
  3251.  Modifies flags: DF
  3252.  
  3253.  
  3254.  Sets the Direction Flag to 1 causing string instructions to
  3255.  auto-decrement SI and DI instead of auto-increment.
  3256.  
  3257.  
  3258. %                           Clocks             Size
  3259. %Operands              86/88  286   386       # Bytes
  3260.  
  3261.  none                    2     2     2           1
  3262. :sti
  3263. ^STI - Set Interrupt Flag  (Enable Interrupts)
  3264.  
  3265.  
  3266.  Usage: STI
  3267.  Modifies flags: IF
  3268.  
  3269.  
  3270.  Sets the Interrupt Flag to 1, enabling recognition of all CPU
  3271.  hardware interrupts.
  3272.  
  3273.  
  3274. %                           Clocks             Size
  3275. %Operands              86/88  286   386       # Bytes
  3276.  
  3277.  none                    2     2     2           1
  3278. :stos:stosb:stosw:stosd
  3279. ^STOS - Store String  (Byte, Word or Doubleword)
  3280.  
  3281.  
  3282.  Usage: STOS  dest
  3283.         STOSB
  3284.         STOSW
  3285.         STOSD
  3286.  Modifies flags: None
  3287.  
  3288.  
  3289.  Stores value in accumulator to location at ES:DI (even if operand
  3290.  is given).   (E)DI is incremented/decremented based on the size of
  3291.  the operand (or instruction format) and the state of the Direction
  3292.  Flag.   Use with REP prefixes.
  3293.  
  3294.  
  3295. %                           Clocks             Size
  3296. %Operands              86/88  286   386       # Bytes
  3297.  
  3298.  dest                    11    3     4          1    (W88=15)
  3299. :str
  3300. ^STR - Store Task Register (286/386 privileged)
  3301.  
  3302.  
  3303.  Usage: STR  dest
  3304.  Modifies flags: None
  3305.  
  3306.  
  3307.  Stores the current Task Register to the specified operand.
  3308.  
  3309.  
  3310. %                           Clocks             Size
  3311. %Operands              86/88  286   386       # Bytes
  3312.  
  3313.  reg16                   -     2     2          3
  3314.  mem16                   -     3     2          5
  3315. :sub
  3316. ^SUB - Subtract
  3317.  
  3318.  Usage: SUB  dest,src
  3319.  Modifies flags: AF CF OF PF SF ZF
  3320.  
  3321.  
  3322.  The source is subtracted from the destination and the result is
  3323.  stored in the destination.
  3324.  
  3325. %                           Clocks             Size
  3326. %Operands              86/88  286   386       # Bytes
  3327.  
  3328.  reg,reg                 3     2     2           2
  3329.  mem,reg               16+EA   7     6          2-4  (W88=24+EA)
  3330.  reg,mem                9+EA   7     7          2-4  (W88=13+EA)
  3331.  reg,immed               4     3     2          3-4
  3332.  mem,immed             17+EA   7     7          3-6  (W88=25+EA)
  3333.  accum,immed             4     3     2          2-3
  3334.  
  3335.  - see  EA for calculation of Effective Address "EA"
  3336. :test
  3337. ^TEST - Test For Bit Pattern
  3338.  
  3339.  Usage: TEST  dest,src
  3340.  Modifies flags: CF OF PF SF ZF (AF undefined)
  3341.  
  3342.  
  3343.  Performs a logical AND of the two operands updating the flags
  3344.  register without saving the result.
  3345.  
  3346.  
  3347. %                           Clocks             Size
  3348. %Operands              86/88  286   386       # Bytes
  3349.  
  3350.  reg,reg                 3     2     1           2
  3351.  reg,mem                9+EA   6     5          2-4   (W88=13+EA)
  3352.  mem,reg                9+EA   6     5          2-4   (W88=13+EA)
  3353.  reg,immed               5     3     2          3-4
  3354.  mem,immed             11+EA   6     5          3-6
  3355.  accum,immed             4     3     2          2-3
  3356.  
  3357.  - see  EA for calculation of Effective Address "EA"
  3358. :verr
  3359. ^VERR - Verify Read (286/386 protected)
  3360.  
  3361.  
  3362.  Usage: VERR  src
  3363.  Modifies flags: ZF
  3364.  
  3365.  
  3366.  Verifies the specified segment selector is valid and is readable
  3367.  at the current privilege level.   If the segment is readable,
  3368.  the Zero Flag is set, otherwise it is cleared.
  3369.  
  3370.  
  3371. %                           Clocks             Size
  3372. %Operands              86/88  286   386       # Bytes
  3373.  
  3374.  reg16                   -     14    10          3
  3375.  mem16                   -     16    11          5
  3376. :verw
  3377. ^VERW - Verify Write (286/386 protected)
  3378.  
  3379.  
  3380.  Usage: VERW  src
  3381.  Modifies flags: ZF
  3382.  
  3383.  
  3384.  Verifies the specified segment selector is valid and is ratable
  3385.  at the current privilege level.   If the segment is writable,
  3386.  the Zero Flag is set, otherwise it is cleared.
  3387.  
  3388.  
  3389. %                           Clocks             Size
  3390. %Operands              86/88  286   386       # Bytes
  3391.  
  3392.  reg16                   -     14    15          3
  3393.  mem16                   -     16    16          5
  3394. :wait:fwait
  3395. ^WAIT/FWAIT - Event Wait
  3396.  
  3397.  
  3398.  Usage: WAIT
  3399.         FWAIT
  3400.  Modifies flags: None
  3401.  
  3402.  
  3403.  CPU enters wait state until the coprocessor signals it has finished
  3404.  it's operation.   This instruction is used to prevent the CPU from
  3405.  accessing memory that may be temporarily in use by the coprocessor.
  3406.  WAIT and FWAIT are identical.
  3407.  
  3408.  
  3409. %                           Clocks             Size
  3410. %Operands              86/88  286   386       # Bytes
  3411.  
  3412.  none                    4     3     6           1
  3413. :xchg
  3414. ^XCHG - Exchange
  3415.  
  3416.  
  3417.  Usage: XCHG  dest,src
  3418.  Modifies flags: None
  3419.  
  3420.  
  3421.  Exchanges contents of source and destination.
  3422.  
  3423.  
  3424. %                           Clocks             Size
  3425. %Operands              86/88  286   386       # Bytes
  3426.  
  3427.  reg,reg                 4     3     3           2
  3428.  mem,reg               17+EA   5     5          2-4  (W88=25+EA)
  3429.  reg,mem               17+EA   5     5          2-4  (W88=25+EA)
  3430.  accum,reg               3     3     3           1
  3431.  reg,accum               3     3     3           1
  3432.  
  3433.  - see  EA for calculation of Effective Address "EA"
  3434. :xlat:xlatb
  3435. ^XLAT/XLATB - Translate
  3436.  
  3437.  
  3438.  Usage: XLAT  translation-table
  3439.         XLATB   (masm 5.x)
  3440.  Modifies flags: None
  3441.  
  3442.  
  3443.  Replaces the byte in AL with byte from a user table addressed by
  3444.  BX by using the original AL as the index into the translate table.
  3445.  
  3446.  
  3447. %                           Clocks             Size
  3448. %Operands              86/88  286   386       # Bytes
  3449.  
  3450.  table                   11    5     5           1
  3451. :xor
  3452. ^XOR - Exclusive OR
  3453.  
  3454.  Usage: XOR  dest,src
  3455.  Modifies flags: CF OF PF SF ZF (AF undefined)
  3456.  
  3457.  
  3458.  Performs a bitwise exclusive OR of the two operands and returns
  3459.  the result in the destination.
  3460.  
  3461.  
  3462. %                           Clocks             Size
  3463. %Operands              86/88  286   386       # Bytes
  3464.  
  3465.  reg,reg                 3     2     2           2
  3466.  mem,reg               16+EA   7     6          2-4  (W88=24+EA)
  3467.  reg,mem                9+EA   7     7          2-4  (W88=13+EA)
  3468.  reg,immed               4     3     2          3-4
  3469.  mem,immed             17+EA   7     7          3-6  (W88=25+EA)
  3470.  accum,immed             4     3     2          2-3
  3471.  
  3472.  - see  EA for calculation of Effective Address "EA"
  3473.